.htaccess - How to Remove .php Extension From Url and show 404 error when user try to enter url with .php extension -


I am able to remove the .php extension from the URL, but I need the user URL with the .php extension You should show the page

You can insert this code. To hide the .php extension in the DOCUMENT_ROOT / .htaccess file:

  reriteagain on REVERASE / # externally /file.php To redirect / file / revoked code% {THE_REQUEST} \ s / + (?: Index)? (. *?) \. Php [\ s?] [NC] rewriting rule ^% 1 [R = 301, L, NE] # Internally forward / File to /file.php Rewrite angle% {REQUEST_FILENAME}! -d RecoveryCand% {DOCUMENT_ROOT} / $ 1 .php -f [NC] Rewritable ^ (. +?) /? $ $ 1.php [L]  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -