在.htaccess从URL删除Word [英] In .htaccess remove word from URL

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

问题描述

在搜索的一个多小时,我仍然无法弄清楚如何从 HTTP重定向链接://网站/ FR /其他的http://网站/其他

我用这code:

  RewriteEngine叙述上
重写规则^ / FR /(.*)$ / $ 1 [L,R = 301,QSA]
 

解决方案

只是删除​​第一个正斜杠:重写规则^ FR /(.*)$ / $ 1 [L,R = 301,QSA]

尝试了这一点,在 http://htaccess.madewithlove.be/

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.

I am using this code:

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

解决方案

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

Try this out at http://htaccess.madewithlove.be/.

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

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