.htaccess更改网址路径 [英] .htaccess to change the url path
问题描述
我尝试了一些在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屋!