TechTutorials - Free Computer Tutorials  







htaccess and URL Redirection 
 


Added: 11/20/2005, Hits: 3,570, Rating: 0, Comments: 0, Votes: 0
Add To Favorites | Comment on this article
This entry is just going to be a quick explanation on how to redirect URLs using your .htaccess file. This can be very handy if you reorganize your web site and move a section to a new location, change your sites domain name, and in many other situations.

In our example, one of our bloggers wanted to have the URL http://www.techtutorials.net/foxynox/ forward to his blog which was located at:

http://www.techtutorials.net/blogs/index.php?mode=viewuser&user_id=2

In order to do this we simply need to open and edit our .htaccess file. If you are not familiar with this file, search our tutorials directory for more information. In this case, we entered:

Code :

Redirect /foxynox http://www.techtutorials.net/blogs/index.php?mode=viewuser&user_id=2

The redirect command tells Apache to forward traffic from the 1st item listed to the 2nd item. The first item is /foxynox. This needs to be entered in path format where / is your webroot. I believe the 2nd item must be entered in URL format, although I have not yet tried a path.

It is just that simple!





Comments (0)

Be the first to comment on this article


Related Items








7 Seconds Resources, Inc.




IT Showcase