Log in

View Full Version : Mod_Rewrite on one single php page



Ryan Fitton
11-25-2009, 08:28 AM
Hi, I am wanting to know if it is poossible to Mod_Rewrite one single .php page, so an example that i want would be...

Http://www.ryanfitton.co.uk/contact.php

and I want it to be Mod_Rewrite to....

http://www.ryanfitton.co.uk/contact/


Is this possible for just the contact.php page? because I don't want all of my pages to be like this.


Many thank, Ryan.

techietim
11-25-2009, 11:21 AM
This should do it for you:


RewriteEngine on
RewriteRule ^contact/?$ contact.php

Ryan Fitton
11-25-2009, 05:42 PM
this code does not seem to be working for me i have put it at the top of my .htaccsess file which is in the root of my directory, however when i try and accsess http://www.ryanfitton.co.uk/contact.php it stay as it is and when i access http://www.ryanfitton.co.uk/contact/ it shows a 404 error

techietim
11-25-2009, 07:58 PM
It is a server configuration issue, as the code works properly. Contact your web host (1&1) and see what's up.