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
Post a Comment