Pirat3
03-14-2008, 02:47 AM
Hi, I have a linux server and have run into a issue.
I host 2 websites off of 1 server.
I did a 301 redirect in the .httacess file on each domain to have it redirct to the www. domain.
For example when a user goes to:
site1.com it would redirect them to www.site1.com
However my second domain it does not work this way, when I go to
site2.com it redirects me to www.site1.com
How can I get my second domain to redirect me to www.site 2.com?
Here is part of my httacess file that deals with redirect for 1 domain, both are same , except where the domain name goes is changed to reflect the domain :P
Code:
RewriteCond %{HTTP_HOST} !^www\.site1\.com
RewriteRule (.*) http://www.site1.com/$1 [L,R=301]
Thanks in advanced
Clarify:
They are in diffrent dircetories.
Site 1 is in /root/home/site1/public_html/
site 2 is in /root/home/site2/public_html/
each site has its own htttpaccess, so which one do I edit or do I have this all setup wrong?
I host 2 websites off of 1 server.
I did a 301 redirect in the .httacess file on each domain to have it redirct to the www. domain.
For example when a user goes to:
site1.com it would redirect them to www.site1.com
However my second domain it does not work this way, when I go to
site2.com it redirects me to www.site1.com
How can I get my second domain to redirect me to www.site 2.com?
Here is part of my httacess file that deals with redirect for 1 domain, both are same , except where the domain name goes is changed to reflect the domain :P
Code:
RewriteCond %{HTTP_HOST} !^www\.site1\.com
RewriteRule (.*) http://www.site1.com/$1 [L,R=301]
Thanks in advanced
Clarify:
They are in diffrent dircetories.
Site 1 is in /root/home/site1/public_html/
site 2 is in /root/home/site2/public_html/
each site has its own htttpaccess, so which one do I edit or do I have this all setup wrong?