搜索的一个多小时后,我仍然无法弄清楚如何链接重定向来自http://site/fr/other
到http://site/other
。
我使用此代码:
RewriteEngine On
RewriteRule ^/fr/(.*)$ /$1 [L,R=301,QSA]
搜索的一个多小时后,我仍然无法弄清楚如何链接重定向来自http://site/fr/other
到http://site/other
。
我使用此代码:
RewriteEngine On
RewriteRule ^/fr/(.*)$ /$1 [L,R=301,QSA]
只是去除第一正斜杠: RewriteRule ^fr/(.*)$ /$1 [L,R=301,QSA]
在尝试了这一点http://htaccess.madewithlove.be/ 。
从URL中移除“-xyz-”
RewriteRule ^(.*)-xyz-(.*).html$ http://%{SERVER_NAME}/$1-$2.html [NC,R=301,L]
要从URL'某某“ http://yoursite.com/xyz/some-url.html ”
RewriteRule ^xyz/(.*)\.html$ $1-watches.html [L,R=301]
要从URL'某某“ http://yoursite.com/some-dir/xyz/some-url.html ”
RewriteRule ^(.*)/xyz/(.*).html$ http://%{SERVER_NAME}/$1/$2.html [NC,R=301,L]