How to pass parameters in Rewrite Rules with specifying the .php file name?

Viewed 1764

I have a site, which successfully passes the content after the first slash to a specified .php file. (elegantly: remove ".php")

site.com/azamat to site.com/azamat.php

RewriteCond %{REQUEST_FILENAME} !-d    
RewriteCond %{REQUEST_FILENAME}\.php -f   
RewriteRule ^(.*)$ $1.php [NC]

How can I add additional parameters to these rules, so I can pass "page" parameters, like:

site.com/azamat/bagatov to site.com/azamat.php?page=bagatov

or

site.com/thisisthefile/andparams to site.com/thisisthefile.php?page=andparams

1 Answers
Related