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.

有帮助吗?

解决方案

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

RewriteEngine On

RewriteRule ^something_en(/.*)?$ /something$1 [L,NC,R=301]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top