Portal Home > Knowledgebase > Articles Database > .htaccess issues - Redirect


.htaccess issues - Redirect




Posted by web_hosting4u, 09-08-2008, 11:33 PM
I saw another post in here relative to .htaccess and redirecting domains, however, I am not getting the output that I think I desire. I have a site http://www.oldsite.com and we purchased a new domain and rebuilt the site from scratch. The new domain is http://www.newdomain.com for instance. We have the need to ensure all traffic forwards to http://www.newdomain.com even if someone visits a bookmark. The following rewrite example gets me part of the way there and I have tried a couple of modified instances of the rewrite RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.newdomain.\org$ [NC] RewriteRule ^(.*)$ http://www.newdomain.org/$1 [L,R=301] When I visit previously bookmarked sites I am taking to the new home page, however I get this as well: http://www.newdomain.com/modules.php...e=print&sid=47 which is still a reference to the old site. Is there away to get it to drop the garbage at the end? I have tried removing the $1 as suggested in another thread, but to no avail. Thanks for any assistance.

Posted by SparkSupport, 09-09-2008, 06:21 AM
In the code you gave, you used .org instead of .com ( or was that a typo ?? ) Also, in your code, you used the escape character "\" before the alphabet "o" instead of using it before ".". Escape character should be used before a special character, not after it. Try this code: Good Luck

Posted by web_hosting4u, 09-09-2008, 07:07 AM
No, the domain in question is a.org to a new .org. I'll try the above. Thanks.

Posted by shellcrash, 09-10-2008, 04:47 PM
Redirect OLDURL NEWURL



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Softlayer Cloud (Views: 645)
High CPU load (Views: 643)
MTA's poor reputation (Views: 708)

Language: