Forum Moderators: phranque
I was searching this great forum before i post but i didn't catch any answer for my problem, hope you can help me guys .
my websites are all hosted on a single hosting account , i have :
domain1.com pointed to public_html/index.html
domain2.com pointed to public_html/scriptxx/index.html
I got a new domain (domain3.com) and pointed to public_html/scriptxx/index.html .. where domain2.com is also pointed .
Now i want search engines to archive domain3 and to forward the domain2 PR to domain3 , so i created a new directory public_html/test-folder/ and pointed domain2 to it from my hosting panel , and was trying to implement a 301 in .htaccess.
The methods that i used :
RedirectMatch 301 ^(.*)$ http://www.domain3.com
RedirectMatch 301 (.*) http://www.domain3.com/
Redirect 301 / http://www.domain3.com
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.domain3.com/$1 [R=301,L]
But im always getting 500 server error with each one , so what's wrong with my code ?
Thank you very much.
[edited by: jdMorgan at 10:23 pm (utc) on Dec. 6, 2008]
[edit reason] De-linked URLs in code [/edit]
The solution is to use a RewriteCond on your RewriteRule, so that only domain2 requests get redirected to domain3:
RewriteCond %{HTTP_HOST} domain2\.com
RewriteRule (.*) http://www.domain3.com/$1 [R=301,L]
Jim