Last active
February 21, 2018 00:05
-
-
Save levidurfee/a8be3448cb35f6cb99de4bbbe8eef6fb to your computer and use it in GitHub Desktop.
htaccess
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
allow from all | |
deny from 1.2.3.4 # blocks one IP address | |
deny from 1.3 # blocks every IP beginning with 1.3 |
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 | |
RewriteBase / | |
# Removes index.php | |
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /index.php/$1 [L] | |
# If 404s, "No Input File" or every URL returns the same thing | |
# make it /index.php?/$1 above (add the question mark) |
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
# Redirect domain.com to www.domain.com | |
RewriteCond %{HTTP_HOST} !^www\.DOMAIN\.com$ | |
RewriteRule (.*) http://www.DOMAIN.com/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment