Joomla 使用 .htaccess 重定向查询字符串
Joomla redirect query string with .htaccess
如何重定向https://www.themaidsofcharleston.com/?Itemid= to https://www.themaidsofcharleston.com/
我试过了
RewriteCond %{QUERY_STRING} ^?Itemid=$
RewriteRule ^/$ /? [R=301,L]
但 id 不起作用
提前谢谢你。
这里有两个问题需要解决:
{QUERY_STRING}
不包含前导问号 - 您要检查 ^Itemid=$
在 .htaccess 上下文中配置重写时,路径永远不会以 /
开头,此时已经被剥离。所以你的规则需要匹配一个空路径,^$
如何重定向https://www.themaidsofcharleston.com/?Itemid= to https://www.themaidsofcharleston.com/
我试过了
RewriteCond %{QUERY_STRING} ^?Itemid=$
RewriteRule ^/$ /? [R=301,L]
但 id 不起作用
提前谢谢你。
这里有两个问题需要解决:
{QUERY_STRING}
不包含前导问号 - 您要检查^Itemid=$
在 .htaccess 上下文中配置重写时,路径永远不会以
/
开头,此时已经被剥离。所以你的规则需要匹配一个空路径,^$