One of the most common uses for .htaccess, not counting custom error pages, is to use it for redirecting. By using .htaccess you can redirect a users request to a whole other file, or even better, a whole other website, and all instantly. Lets take a look at the command we use to accomplish this:
Redirect /folder/sub_folder/page.php http://www.somesite.com/folder/page.php
In the above example, everytime a user sends a request to the server asking to access the file page.php, which is stored in folder/sub_folder, the server will reply with the url to the new website (www.somesite.com in this case). This all happens within milliseconds, so the user doesn't notice anything except for a different address in his address bar. |