我想将mysite.com/index.php重定向到mysite.com/index.php?id_category=12&controller=category
这是我的htaccess文件。
但它不起作用。Chrome说:This webpage has a redirect loop。
Options +FollowSymLinks +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
RewriteRule index\.php http://mysite.com/index.php?id_category=12&controller=category发布于 2012-12-04 18:16:23
这应该是可行的:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index.php$
RewriteCond %{QUERY_STRING} ^$
RewriteRule (.*) http://www.mywebsite.com/index.php?foo=bar [R=301,L]第一个条件检查URI是否等于index.php,第二个条件检查GET值是否为空。这两个条件之间的AND在这里是隐含的。
发布于 2012-12-04 18:13:22
也许您应该更改,使用另一个文件名,而不是index.php作为目标。但是你可以试试:
RewriteRule index.php index.php?id_category=12&controller=category
https://stackoverflow.com/questions/13700240
复制相似问题