rjn Posted March 14, 2009 Posted March 14, 2009 I have a new domain name, with the old domain name parked. The problem that I am having is that all urls containing the domain name redirect to the home page of the new domain name. Here is an example: Input the following: http://www.15minutestoriches.com/2009/01/0...-your-expenses/ Redirects to: http://www.wealthitself.com I want it to redirect to: http://www.wealthitself.com/2009/01/04/5-r...-your-expenses/ Here is the code in the .htaccess file ><IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> RewriteBase / RewriteCond %{HTTP_HOST} ^(www\.)?15minutestoriches\.com RewriteRule (.*) http://www.wealthitself.com/$1 [R=301,L] Any suggestions? Thanks Quote
OJB Posted March 14, 2009 Posted March 14, 2009 (edited) will this work? ><IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> RewriteCond %{HTTP_HOST} ^15minutestoriches.com$ [OR] RewriteCond %{HTTP_HOST} ^www.15minutestoriches.com$ RewriteRule ^(.*)$ http://www.wealthitself.com/$1 [R=301,L] I think the thing you have missed is the the full regular expression ... (.*) in the rewrite rule might need to be ^(.*)$ to denote the start and end of the string. I am no mod rewrite expert though but worth a shot? Edited March 14, 2009 by OJB Quote
rjn Posted March 14, 2009 Author Posted March 14, 2009 Thanks - I tried it but it didn't work. will this work? ><IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> RewriteCond %{HTTP_HOST} ^15minutestoriches.com$ [OR] RewriteCond %{HTTP_HOST} ^www.15minutestoriches.com$ RewriteRule ^(.*)$ http://www.wealthitself.com/$1 [R=301,L] I think the thing you have missed is the the full regular expression ... (.*) in the rewrite rule might need to be ^(.*)$ to denote the start and end of the string. I am no mod rewrite expert though but worth a shot? 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.