.htaccess更改网址路径 [英] .htaccess to change the url path

查看:107
本文介绍了.htaccess更改网址路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了一些在StackOverflow上找到的解决方案示例,但似乎都无法正常工作.

I have tried several examples of solutions that I have found here on StackOverflow but none of them seem to work correctly.

我有一个Magento商店,我需要将旧的商店代码URL重定向到新的URL.例如:

I have a Magento store that I need to redirect an old store code url to the new one. For example:

旧网址看起来像这样.

www.example.com/something_zh_CN

www.example.com/something_en

在上面的示例中,我需要能够修改包含在路径something_en中的所有url,并将其更改为something,如在下一个示例中一样.

In the above example I need to be able to modify any url that contains to the path something_en and change it to something like in the next example.

www.example.com/something

www.example.com/something

非常感谢您的帮助.

推荐答案

请确保这是您在主.htaccess中的第一条规则:

Make sure this is your very first rule in main .htaccess:

RewriteEngine On

RewriteRule ^something_en(/.*)?$ /something$1 [L,NC,R=301]

这篇关于.htaccess更改网址路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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