this is my code
RewriteEngine on
RewriteRule ^public/p-(.*)\&(.*)?$ public/index.php?page=$1.php&$2 [NC,L]
RewriteRule ^public/p-(.*)$ public/index.php?page=$1.php
This is the URL
http://localhost/riviera/public/p-job-steps&job_id=7&step=1
Output is
Array ( [page] => job-steps [job_id] => 7.php [step] => 1 )
I just want to append “.php” to first parameter
I wasted my 4-5 hours in achieving this target and I do not want to modify url structure of app I’m building.
Please help someone!
There is a simple flag named QSA that will do all the work for you.
Write in the htaccess the following:
I tested it, and it gives:
When the url is:
And you should add B for security reasons.