Posts

Showing posts with the label htaccess

How to use mod_rewrite in .htaccess - Simple tutorial

Here is my little experience on using mod_rewrite and .htaccess: Environment: Ubuntu 6.10 - Apache 2.0.55 + PHP5 To start using mod_rewrite: 1. In your httpd.conf (In my case: apache2.conf), you will notice a line AccessFileName .htaccess Please ensure this line exist in your httpd.conf anywhere. 2. Still in httpd.conf: Find out your web root directory defined in <Directory> tags. This is the directory where you would place your .htaccess file in. Once your .htaccess file, which will be made later, is put in this directory, it will take effect immediately, without restart/reload your apache2. Please find out the following line: AllowOverride None and change it to AllowOverride All This make the text(directive) which is defined in .htaccess work. AllowOverride means "What text(directive) is allowed to be override by .htaccess?". So, if AllowOverride is "None", it means that .htaccess cannot override anything = useless. 3. At anywhere in ...