.htaccess to change the url path

耗尽温柔 提交于 2019-12-12 09:16:42

问题


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

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

The old url looked like this.

www.example.com/something_en

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

Any help is much appreciated.


回答1:


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

RewriteEngine On

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


来源:https://stackoverflow.com/questions/21554975/htaccess-to-change-the-url-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!