Created
January 19, 2020 13:58
-
-
Save ipang-dwi/e919295b12b8f03546d8e895de0780ac to your computer and use it in GitHub Desktop.
htaccess to hide .php extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
# turn on the mod_rewrite engine | |
RewriteCond %{REQUEST_FILENAME}.php -f | |
# IF the request filename with .php extension is a file which exists | |
RewriteCond %{REQUEST_URI} !/$ | |
# AND the request is not for a directory | |
RewriteRule (.*) $1\\.php [L] | |
# redirect to the php script with the requested filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment