Remove .php extension with PHP

If you’re serving via Apache, you’ll want to look at mod_rewrite.

Using mod_rewrite, you can modify how URLs are mapped to your application’s actual end-points. For your example, you’ll want something like this:

RewriteEngine on 
RewriteRule ^/?page/(.*)$ page.php/$1 [L]

This page has some other simple examples.

Leave a Comment