If you have your website hosted on a Unix server, you most likely have an .htaccess file in the root directory of your website. This file is very powerful, allowing you to redirect requests for certain URL’s in your website to other URL’s in your website.
In my case, I was already using domain name forwarding through a domain name registrar to forward www.olddomain.com to www.newdomain.com/olddomain, a subfolder located at my new domain name.
But now, I wanted all the requests for www.newdomain.com/olddomain to go to www.newdomain.com/newfolder.
So I had to add the following line of code to the .htaccess file at www.mynewdomain.com/.htaccess:
Redirect /olddomain http://www.newdomain.com/newfolder
And voila, problem is solved.











No comments
Comments feed for this article
Trackback link: http://www.electric-webs.com/blog/2009/09/14/redirect-urls-using-htaccess-files/trackback/