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

Lists in Python -

android - can not access to progress bar in an other activity -

java - Vaadin 7 Pass Data Between Views -