Created
September 20, 2016 22:16
-
-
Save cpereiraweb/ed7706d7397a1200880f70af0515d861 to your computer and use it in GitHub Desktop.
Laravel rodando em alias (url subdir) no Apache 2.4
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
#1) crie os alias para o subdir | |
Alias /crm/ /srv/www/portais/crm/public/ | |
Alias /crm /srv/www/portais/crm/public/ | |
#2) defina as permissões do diretório físico | |
<Directory "/srv/www/portais/crm/public/"> | |
AllowOverride All | |
Options Indexes FollowSymLinks MultiViews Includes ExecCGI | |
Require all granted | |
</Directory> | |
#3) defina as configurações do Location | |
<Location /crm> | |
RewriteEngine On | |
RewriteBase "/crm/" | |
# Redirect Trailing Slashes If Not A Folder... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)/$ /$1 [L,R=301] | |
# Handle Front Controller... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.php [L] | |
# Handle Authorization Header | |
RewriteCond %{HTTP:Authorization} . | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
</Location> | |
<Location /crm/> | |
RewriteEngine On | |
RewriteBase "/crm/" | |
# Redirect Trailing Slashes If Not A Folder... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)/$ /$1 [L,R=301] | |
# Handle Front Controller... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.php [L] | |
# Handle Authorization Header | |
RewriteCond %{HTTP:Authorization} . | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
</Location> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment