1
votes

What I'm trying to establish is, to make the below to page.php with parameter

http://localhost/project/page.php?id=1

accessible by

http://localhost/project/page1

Carry out the same for all pages from id changes.

If /page2 then /page.php?id=2
If /page3 then /page.php?id=3
...

1
Google for php,mod_rewrite and front controller - Felippe Duarte
Which platform are you running this on? I would suggest doing this with a redirect, (.htaccess on apache2) (web.config on IIS) etc. - Mike Jouwstra

1 Answers

-1
votes

You can do it using .htaccess .Below is the example. You can go through htaccess rewrite rules.

RewriteRule ^page/([0-9]+)/?$ page.php?id=$1 [NC,L]

Please mark as answer if it helps