jou00jou Posted December 12, 2008 Share Posted December 12, 2008 As the subject suggests, I would like to use Mod Rewrite to rewrite the url from example.com/contact.php to example.com/contact I am currently learning how to use mod rewrite and read at least 10 tutorials but for some reasons I still can't create the rule. I simply need to remove the php trailer in all the files in the directory. Here is the what I thought would work. RewriteRule ^([a-z]+)$ /$1.php [L] Below are other combinations I tried RewriteRule ^([a-z]+)$ $1.php [L] (no slash before $1) RewriteRule ^(.*)$ /$1.php [L] ... I tried more combinations but really there is no point of writing them all. Any ideas. Thanks in advance. By the way mod rewrite works on my server. I use it to rewrite www.example.com to example.com Link to comment https://forums.phpfreaks.com/topic/136622-mod-rewrite-examplecomcontactphp-to-examplecomcontact/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.