Last active
December 10, 2015 21:50
-
-
Save steveosoule/4497601 to your computer and use it in GitHub Desktop.
Common .htaccess Settings
This file contains hidden or 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
| ### SOURCE: http://stackoverflow.com/questions/6847649/htaccess-help-need-to-force-www-https-and-remove-index-php | |
| ### Force WWW: | |
| RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] | |
| RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] # include 's' here to force ssl in addition to www | |
| ### Force SSL: | |
| RewriteCond %{SERVER_PORT} 80 | |
| RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] | |
| Remove "index.php": | |
| ### Remove "index.php" | |
| RewriteCond %{THE_REQUEST} /index.php HTTP | |
| RewriteRule (.*)index.php$ /$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment