Skip to content

Instantly share code, notes, and snippets.

@jorenvh
Created July 24, 2017 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorenvh/b19efb15b77217da7466a0b8b080c382 to your computer and use it in GitHub Desktop.
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
# 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