Use a mod_rewrite with .htaccess file
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.
