Last active
February 16, 2018 23:38
-
-
Save toledox82/c9234f60c763a543fc08 to your computer and use it in GitHub Desktop.
My default .htaccess
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
RewriteEngine On | |
# RewriteBase / | |
# Force SSL and Non-WWW for main domain (except local) | |
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com\.br$ [NC] | |
RewriteCond %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} ^www\. [NC] | |
RewriteRule ^ https://domain.com.br%{REQUEST_URI} [R=301,L,NE] | |
### Remove .php | |
# RewriteCond %{REQUEST_FILENAME} !-d | |
# RewriteCond %{REQUEST_FILENAME}\.php -f | |
# RewriteRule ^(.*)$ $1.php | |
# RewriteRule ^index\.php$ / [R] | |
### Error Pages | |
# ErrorDocument 404 /404.html | |
### File Access | |
Options -Indexes | |
### Redirects | |
# Redirect /path http://site.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment