经过一个多小时的搜索,我仍然无法弄清楚如何将链接从 http://site/fr/other
重定向到 http://site/其他
.
我正在使用此代码:
RewriteEngine On
RewriteRule ^/fr/(.*)$ /$1 [L,R=301,QSA]
最佳答案
只需删除第一个正斜杠:RewriteRule ^fr/(.*)$/$1 [L,R=301,QSA]
。
在 http://htaccess.madewithlove.be/ 上试试这个.
关于regex - 在 .htaccess 中从 URL 中删除单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10839047/