.htaccess URL redirection

0

Hello,

I would like to know if you have how to configure the .htaccess for when a person accesses the site through the domain mysite.com he redirects to the / site2 / folder and who accesses the domain mysite2.com he redirects to / site1 /, is I'm using a VPS and I do not want to mess with it.

    
asked by anonymous 09.02.2015 / 01:33

1 answer

0

You can do this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?meusite.com$
RewriteRule . site2 [R=301,L]

RewriteCond %{HTTP_HOST} ^(www.)?meusite2.com$
RewriteRule . site1 [R=301,L]

Who accesses the domain (www.)meusite.com will be redirected to meusite.com/site2 and who access by (www.)meusite2.com will be redirected to meusite2.com/site1 .

    
09.02.2015 / 01:50