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