.htaccess - Hide php extension Not working -


this question has answer here:

i using godaddy shared server web site. tried url rewriting hide php extension .htaccess file. have tried possible ways found on net.but none of them work me. requirement in clear www.mydomain.com/site1/home.php want see www.mydomain.com/site1/home in same way php pages. thankful if 1 can me code.

and if sub domain url php rewrite works? www.mydomain.com/subdomain/site1/index.php want www.mydomain.com/subdomain/site1/index

thanks in anticipation, srikanth

you can use in .htaccess file:

rewriteengine on rewritebase /  rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^(.+)$ $1.php [l] 

this rewrite isn't directory, , rewrites if url .php added end of exists. example: if go www.domain.com/help, www.domain.com/help.php doesn't exist won't rewrite.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -