Created
July 7, 2016 01:15
-
-
Save jjsquady/e914583ee49a2ca4de30a14c5a739874 to your computer and use it in GitHub Desktop.
Arquivo .htaccess para hospedagem compartilhada (Laravel)
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 / | |
| |
# Rewrite to pulic | |
RewriteCond %{HTTP_HOST} ^example.com$ [NC,OR] | |
RewriteCond %{HTTP_HOST} ^example.com$ | |
RewriteCond %{REQUEST_URI} !public/ | |
RewriteRule (.*) /public/$1 [L] | |
| |
# Redirect www to domain | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] | |
| |
# Deny access to framework directories | |
RewriteRule ^(app|bootstrap|config|database|resources|storage|tests|vendor|node_modules)/ - [R=404,L,NC] | |
| |
# And dot files/folders (for example .env) | |
RedirectMatch 404 /\..*$ | |
| |
# Redirect Trailing Slashes... | |
RewriteRule ^(.*)/$ /$1 [L,R=301] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment