Mobile Phone deals - Car Credit - Online Image Resizer - Credit Cards - Mortgages

PDA

View Full Version : /page/ grabs content page.php


mark_s
Apr 15th 2008, 3:56 am
I have a question and hope someone can help me...

I want it so that if someone types in /page/ the server automatically loads the content of page.php but only shows it as /page/. So whatever typed in, the server will automatically assume the content is in the equivalent filename with .php at the end. Is this possible with mod_rewrite?

jayshah
Apr 15th 2008, 12:03 pm
Yes.

You'd do something like


RewriteEngine On
RewriteRule ^([^/]+)/$ $1.php


Untested, but should form a guide.

Jay

mark_s
Apr 15th 2008, 3:30 pm
That didn't work unfortunately :(

Ni9htRider
Apr 17th 2008, 5:18 pm
RewriteEngine On
RewriteRule ^(.*)/$ $1.php