Home htaccess - 301 redirect not working
Reply: 0

htaccess - 301 redirect not working

Lee
1#
Lee Published in 2017-12-04 15:12:16Z

I have the following htaccess code which redirects any URL containing ar,cl,co,ec,mx,pe or ve to the same URL but with es in it's place.

eg. www.website.com/co/page becomes www.website.com/es/page

<IfModule mod_rewrite.c>

    Options +FollowSymLinks
    RewriteEngine on

    RewriteRule ^/?ar/(.*)$ /es/$1 [R,L]
    RewriteRule ^/?cl/(.*)$ /es/$1 [R,L]
    RewriteRule ^/?co/(.*)$ /es/$1 [R,L]
    RewriteRule ^/?ec/(.*)$ /es/$1 [R,L]
    RewriteRule ^/?mx/(.*)$ /es/$1 [R,L]
    RewriteRule ^/?pe/(.*)$ /es/$1 [R,L]
    RewriteRule ^/?ve/(.*)$ /es/$1 [R,L]


</IfModule>

This works fine on my development server, but not on the live site. Is there a setting somewhere that could prevent this code from running?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.3364 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO