Created
January 6, 2022 12:59
-
-
Save andrii-marushchak/4c3d6c367f35d20f6d9a9350456d4156 to your computer and use it in GitHub Desktop.
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
# Custom 404 page | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ error.php [L] | |
# Force http to https | |
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] | |
# Remove .php from browser url | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php -f | |
RewriteRule ^(.*)$ $1.php [NC,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment