.htaccess中的Apache重写规则问题
我必须永久重定向所有URL:.htaccess中的Apache重写规则问题,apache,.htaccess,url,mod-rewrite,Apache,.htaccess,Url,Mod Rewrite,我必须永久重定向所有URL: http://www.example.com/?par=1248 (with and without the www) 到 使用.htaccess文件 我在上面使用的占位符“par”和“1248”可以是任何内容(字符、数字等)这应该适合您并重定向您想要的URL: RewriteEngine On RewriteCond %{THE_REQUEST} ^(GET|POST)\ /\?(.*)\ HTTP RewriteRule ^ /? [R=301,L] 问题解
http://www.example.com/?par=1248 (with and without the www)
到
使用.htaccess文件
我在上面使用的占位符“par”和“1248”可以是任何内容(字符、数字等)这应该适合您并重定向您想要的URL:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /\?(.*)\ HTTP
RewriteRule ^ /? [R=301,L]
问题解决了!非常感谢您宝贵的回答。没问题,请随意做出正确的回答,以便与您有相同问题的其他用户知道您是如何解决问题的。
RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|POST)\ /\?(.*)\ HTTP
RewriteRule ^ /? [R=301,L]