mercredi 29 avril 2015

.htaccess redirect from subfolder to root keeping paths

I'm migrating a site so I need to redirect all content from a http://ift.tt/1EDpybw to the www.newurl.com and keep all the links, for example:

http://ift.tt/1GFT2os

needs to redirect to

http://ift.tt/1GFT4wD

AND

http://ift.tt/1GFT2oA

needs to redirect to

http://ift.tt/1EDpyrS

my .htacess looks like this:

RewriteEngine on
RewriteRule ^subfolder/(.*)$ /$1 [R=301,L]

It is redirecting all http://ift.tt/1EDpybw to www.newurl.com/ but does not follow the old paths it just sends all request to home page

Aucun commentaire:

Enregistrer un commentaire