regex - Htaccess change php extension -


how can show on browser url php file without .php extension so:

instead home.php , home

how .htaccess, need write in file?

put code in document_root/.htaccess file:

rewriteengine on  rewritecond %{the_request} \s/+(?:index)?(.*?)\.php[\s?] [nc] rewriterule ^ /%1 [r=301,l,ne]  rewritecond %{request_filename} !-d rewritecond %{document_root}/$1\.php -f [nc] rewriterule ^(.+?)/?$ /$1.php [l] 

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 -