我将以下重写规则添加到.htaccess:
RewriteEngine on
RewriteRule ^page/?$ index.php?cat=123 [L]
当我访问www.site.com/page
时会加载/index.php?cat=123的内容问题是我还需要设置从www.site.com/index.php?cat=123到www.site.com/page的重定向 但是当我尝试这样做时,我得到“太多的重定向”错误。任何想法如何解决这个问题?
RewriteEngine on
RewriteRule ^page/?$ index.php?cat=123 [L]
RewriteCond %{QUERY_STRING} ^cat=123$
RewriteRule ^index\.php$ http://www.mysite.com/page [L,R=301]