Created
July 24, 2017 13:05
-
-
Save jorenvh/b19efb15b77217da7466a0b8b080c382 to your computer and use it in GitHub Desktop.
Htacces to combine Laravel & Angular in one project. Angular is used for the front & Laravel as an API for Angular
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
# URL rewrite | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
# Redirect www | |
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] | |
# rewrite to laravel | |
RewriteRule ^(api.*)$ public/$1 [L] | |
# rewrite to angular | |
RewriteRule ^(.*)$ /angular/$1 [QSA,NC,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment