JDev

Code, apacheMay 16, 2007 5:31 pm

To enable url rewriting on a per-directory basis, you need to use an .htaccess file that should be located in the directory used for url
rewriting.

In the .htaccess file, type: 

Options FollowSymLinks
RewriteEngine On

Then use the RewriteRule directive, e.g:

RewriteRule ^oldname.php$ /subsite/newname.php [R] 

A very basic mod_rewrite tutorial is located at http://www.webmastertips.us/tutorials/mod_rewrite.htm 

 However, there is an important detail missing from the tutorial - make sure the <Directory…> container in the httpd.conf file contains the following directive:

 AllowOverride All

If AllowOverride is set to None, no url rewriting will take place. 

Also, do not forget to uncomment the LoadModule rewrite_module modules/mod_rewrite.so directive in the httpd.conf file.

Code, apacheMay 11, 2007 2:07 pm

For creating .htaccess, don’t create it inside Explorer. Open Notepad, type something and SAVE AS “.htaccess” and choose the file type as “ALL FILES”.

From http://sniptools.com/tutorials/windows-apache-and-htaccess-authentication