Redirect site.com/guide/* to newsite.com/guide/* with .htacc
I know that this shouldn't be too hard to do, but the problem is that I have a WordPress in a folder, not the root domain. I have my .htaccess file all set up in the root folder, but not for the WordPress folder.
I wanted to know how to redirect:
www to non-www
site.com/guide/ to newsite.com/guide/
and site.com/guide/some-article/ to newsite.com/guide/some-article/
I was playing around with things, but site.com/guide/some-article/ was redirecting me to newsite.com/some-article/, not newsite.com/guide/some-article/. I would post the code here, but I got rid of it and saved the changes.
The www to non-www seems to be working with this snippet:
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Thanks for the help!
1 Reply
RewriteEngine On
RewriteCond %{HTTP_HOST} site\.com
RewriteRule ^/(.*) http://newsite.com/$1 [R=301,QSA,L]
Untested, but it should work.