Jump to content

How to change page.php to /page/?


Kitty

Recommended Posts

Assuming that you are using apache as the webserver, use mod_rewrite.

Here is a simple example that should do exactly what you asked for. This will process domain.com/foo/ as domain.com/foo.php


[code]
RewriteEngine on
Rewriterule ^foo/ foo.php [L]
[/code]

Now say you wanted to process all requests to domain.com/foo/request/ as /reguest.php you would do this..

[code]
RewriteEngine on
Rewriterule ^foo/(.+)\/ $1.php [L]
[/code]

Hope that helps,
Tom

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.