rjn Posted April 20, 2005 Posted April 20, 2005 I currently have the foolowing to redirect from the old domain name to the new domain name: RewriteEngine on RewriteCond %{HTTP_HOST} ^\.oldsite\.biz\.*$ [NC] RewriteCond %{HTTP_HOST} ^\.oldsite\.$ [NC] RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L] The above does redirect a visitor accessing the homepage, but does not work if accessing through other pages / extensions (e.g., www.oldsite.biz/xyz.php). I searched online and found nothing that worked. It seems as if the solution should be simple - any recommendations? Quote
Thumper Posted April 21, 2005 Posted April 21, 2005 I've used something like this before for redirecting to a subfolder. I changed the code a little. See if this works. >RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{HTTP_HOST} ^www.oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 RewriteCond %{HTTP_HOST} ^oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 Quote
rjn Posted April 21, 2005 Author Posted April 21, 2005 Thumper, thanks for the suggestion, but it didn't work. I get an Internal Server error warning. I've used something like this before for redirecting to a subfolder. I changed the code a little. See if this works. >RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{HTTP_HOST} ^www.oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 RewriteCond %{HTTP_HOST} ^oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 <{POST_SNAPBACK}> Quote
Thumper Posted April 22, 2005 Posted April 22, 2005 I test it a little, and got this much. Maybe it can help you some. It works, but it changes the domain name. Maybe this can get someone else on the right track. >RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{HTTP_HOST} ^www.oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 RewriteCond %{HTTP_HOST} ^oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 Quote
rjn Posted April 22, 2005 Author Posted April 22, 2005 Anyone esle out there want to offer some help in coding this .htaccess file or recommend another option? I test it a little, and got this much. Maybe it can help you some. It works, but it changes the domain name. Maybe this can get someone else on the right track. >RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %{HTTP_HOST} ^www.oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 RewriteCond %{HTTP_HOST} ^oldsite.* RewriteRule ^(.*)$ http://www.newsite.com/$1 <{POST_SNAPBACK}> Quote
TweezerMan Posted April 22, 2005 Posted April 22, 2005 You said you received a 500 Internal Server Error using that code in your .htaccess file. I'd suggest looking at the Error Log in your CPanel and see what the error message is - it should indicate what is wrong with the .htaccess file. Quote
owatagal Posted April 22, 2005 Posted April 22, 2005 I'm a little uncertain what you're trying to achieve. Do you want all the other pages/extensions to keep their old address but show the pages from the new site? Then why not just park those domains over the new one? That seems the simplist way. But if you want everything to show the address of the new site, so that www.oldsite.com/xyz.html will show www.newsite.com/xyz.html in the status bar, try this: >RewriteCond %{HTTP_HOST} ^www\.oldsite\.com$ [NC] RewriteCond %{HTTP_HOST} ^oldsite\.com$ [NC] RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L] This won't mask the new URL--people will see they've been directed to it. But it should let someone who is trying to access a specific page on the old address find it on the new site. If you want the old URL to stay in the status bar, parking the domain seems like the easiest and least complicated solution. Quote
owatagal Posted April 22, 2005 Posted April 22, 2005 Or if you really are just shunting traffic from one site to the next: >RewriteRule /.* http://mynewdomain.com/ [R=301,L] Quote
rjn Posted April 23, 2005 Author Posted April 23, 2005 Thanks for the suggestions, but nothing is working. Or if you really are just shunting traffic from one site to the next: >RewriteRule /.* http://mynewdomain.com/ [R=301,L] <{POST_SNAPBACK}> Quote
TCH-RobertM Posted April 23, 2005 Posted April 23, 2005 The Original .htaccess we set up for you was >RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.oldiste\.biz$ [NC] RewriteRule ^(.*)$ [url=http://newsite.com/$1]http://newsite.com/$1[/url] [R=301,L] Per our conversations Quote
TweezerMan Posted April 23, 2005 Posted April 23, 2005 Here's my shot at it: >RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.oldsite\.biz$ [NC,OR] RewriteCond %{HTTP_HOST} ^oldsite\.biz$ [NC] RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L] Quote
rjn Posted April 23, 2005 Author Posted April 23, 2005 You are the winner Here's my shot at it: >RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.oldsite\.biz$ [NC,OR] RewriteCond %{HTTP_HOST} ^oldsite\.biz$ [NC] RewriteRule ^(.*)$ http://www.newsite.com/$1 [R=301,L] <{POST_SNAPBACK}> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.