htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Redirect /contact/ to /contact.php
PostPosted: 02 Oct 2006 02:16 
Offline
User avatar

Joined: 25 Sep 2006 04:48
Posts: 242
There are a couple simple ways to do this that I use.


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:
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:
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:
RewriteRule ^contact/$ /cgi-bin/contact.php [T=application/x-httpd-php]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB