mod rewrite - .htaccess URL rewriting from foo.php to /foo/ -


how rewrite url from:

http://subdomain.domain.com/dir/foo.php

to

http://subdomain.domain.com/dir/foo/

using htaccess

paste code .htaccess, file residing in dir directory:

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] 

it redirect .php extension, , if type url full .php extension show 404


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -