Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.site.com/photogallery/2010/January-Spring-Photos/

-to-

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

share|improve this question

migrated from stackoverflow.com Jun 9 '11 at 19:35

1 Answer

up vote 2 down vote accepted

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

RewriteEngine On
RewriteRule ^photogallery/(.*)$ http://photos.site.com/$1 [L,R=301,QSA]
share|improve this answer
Works great! thanks – Daniel S Jun 9 '11 at 18:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.