Article Source:


This guide shows you how to use .htaccess to redirect a specific page to another address. This is probably the best way to redirect pages mainly because of the lack of effort it needs to set up and it’s not browser dependent like some redirection scripts. If you have to reorganise a web site or move pages or change page extensions like I have done recently (Dec 02) then this is a life-saver!

web hosting murahWeb Hosting Murah
Menyediakan layanan web hosting Indonesia murah dengan cPanel mendukung PHP, MySql, CMS Joomla dan WordPress.

Simply place the following in your .htaccess file:

Redirect /a-directory/oldpage.htm

The command is always the same and comprises three important parts, the word Redirect, the directory/file you want to redirect relative to the root and the full URL of the file you want to redirect to. These three ‘blocks’ must be on one line and each separated by a single space.

You can use this to redirect entire directories:

Redirect /directory

…or if you have simply changed file extensions:

Redirect /directory/codes.htm

Very simple but extremely useful!

Comments are closed.

Post Navigation