.htaccess带有变量的重定向页面
请帮助修复这些重定向: 重定向1.category/?option=value=>domain.com/category/page.html.htaccess带有变量的重定向页面,.htaccess,mod-rewrite,redirect,.htaccess,Mod Rewrite,Redirect,请帮助修复这些重定向: 重定向1.category/?option=value=>domain.com/category/page.html RewriteCond %{QUERY_STRING} ^option=value(&.*)?$ [NC] RewriteRule ^category/$ http://domain.com/category/page.html%1 [R=301,NE,NC,L] 重定向2.category/sub-%26 category/?option=v
RewriteCond %{QUERY_STRING} ^option=value(&.*)?$ [NC]
RewriteRule ^category/$ http://domain.com/category/page.html%1 [R=301,NE,NC,L]
重定向2.category/sub-%26 category/?option=value=>domain.com/category/page1.html
RewriteCond %{QUERY_STRING} ^option=value(&.*)?$ [NC]
RewriteRule ^category/sub-\x26-category/$ http://domain.com/category/page1.html%1 [R=301,NE,NC,L]
您需要在目标URI中使用
?
删除任何现有查询字符串:
RewriteCond %{QUERY_STRING} ^option=value(&.*)?$ [NC]
RewriteRule ^category/$ /category/page.html? [R=301,NE,NC,L]
RewriteCond %{QUERY_STRING} ^option=value(&.*)?$ [NC]
RewriteRule ^category/sub-\x26-category/$ /category/page1.html? [R=301,NE,NC,L]
确保将这些规则置于其他内部路由规则之上。>确保将这些规则置于其他内部路由规则之上。非常感谢,我在.htaccess的开头添加了重定向,它们现在可以工作了