.htaccess - Rewrite rule in php -


i have url

http://example.com/test.php?pid=105701 

i need remove .php in url.i have tried lot url has going this

http://example.com/test/?pid=105701 

in above url go directory structure. not able access test.php file

this .htaccess file

rewriteengine on rewritecond %{request_filename}.php -f rewritecond %{request_uri} !/$ rewriterule ^(.*)$ $1\.php 

help me on in advance

you have make corrections, should exclude cases contains .php also:

rewriteengine on  # rewrite filename.php rewriterule ^([^.?]+)$ %{request_uri}.php [l]  # return 404 if original request filename.php rewritecond %{the_request} "^[^ ]* .*?\.php[? ].*$" rewriterule .* - [l,r=404] 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -