在 .htaccess 中从 URL 中删除单词 [英] In .htaccess remove word from URL

查看:23
本文介绍了在 .htaccess 中从 URL 中删除单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过一个多小时的搜索,我仍然不知道如何将链接从 http://site/fr/other 重定向到 http://site/其他.

After more than one hour of searching, I still can't figure out how to redirect a link from http://site/fr/other to http://site/other.

我正在使用此代码:

RewriteEngine On
RewriteRule ^/fr/(.*)$ /$1 [L,R=301,QSA]

推荐答案

去掉第一个正斜杠即可:RewriteRule ^fr/(.*)$/$1 [L,R=301,QSA].

Just remove the first forward slash: RewriteRule ^fr/(.*)$ /$1 [L,R=301,QSA].

http://htaccess.madewithlove.be/ 试试这个.

这篇关于在 .htaccess 中从 URL 中删除单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆