1

How can I write a .htaccess mod_rewrite rule to redirect all traffic to a specific subfolder to a different subdomain, but include all the trailing URI and url structure and in a SEO friendly way.

ie.

www.example.com/photogallery/2010/January-Spring-Photos/

to

example.site/2010/January-Spring-Photos/

1 Answer 1

4

You can put this into the root's .htaccess:

RewriteEngine On
RewriteRule ^photogallery/(.*)$ http://photos.site.com/$1 [L,R=301,QSA]
1
  • I just killed a phpbb site and used this to redirect to a static html page. RewriteRule ^view* http://www.wsmcbbs.info/index.html [L,R=301,QSA]
    – Krista K
    Jan 3, 2014 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.