Friday, October 29, 2010

How to use htaccess File



.htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.

In general terms .htaccess is used to redirect your website to any other web address, that means it redirect or transfer the whole site address or any perticular webpage to other address or website.

if u have 2 or more sites / urls you can redirect your one site to other web address. you can understand it form this example used to redirect a site made in PHP language and hosted at LINUX Server.

Example for Sites hosted on LINUX Server in PHP Language :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^http://greenparadize.com/
RewriteRule (.*) http://www.
greenparadize.com/
/$1 [R=301,L]



after writing this code in a text file or notepad just save that file named as .htaccess then upload this file in your  hosting panal.





.