Redirecting http://www.askapache.com/contact/ to http://www.askapache.com/contact.php
Create a directory /contact/ and in the htaccess for that directory have this.
- Code: Select all
DirectoryIndex http://www.askapache.com/contact.php
Better yet, move your contact.php script into the /contact/ directory, and rename it index.html, then use this htaccess code in the /contact/ directory.
- Code: Select all
ForceType application/x-httpd-php
Or if you have your heart set on rewrites, you could put the contact.php in the cgi-bin directory and reference any calls for /contact/ to it. Remove /cgi-bin if you just want /contact.php.
I put all my php scripts in the cgi-bin directory.
- Code: Select all
RewriteRule ^contact/$ /cgi-bin/contact.php [T=application/x-httpd-php]