Created
March 19, 2014 14:14
-
-
Save anlutro/9642488 to your computer and use it in GitHub Desktop.
Separate app in subdirectory for Apache (Laravel 4 and AngularJS example)
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
<VirtualHost *:80> | |
# Client AngularJS application | |
DocumentRoot /var/www/example/client/public | |
# Server Laravel 4 API application | |
Alias /api /var/www/example/server/public | |
# Rewrite all requests in /api to server index.php | |
<Location /api> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ /api/index.php [L] | |
</Location> | |
</VirtualHost> |
Hi, I'm trying to configure my app with this configuration and I still cannot make it work.
Laravel receives the requests but is not being able to find a route. NotFoundHttpException in RouteCollection. I could se that laravel is looking for routes defined as /api/etc (that is correct) but the request path does not includes the /api prefix.
I'm using Laravel 5 and Apache2.
Any idea?
Thank you!
Sebastian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Got any examples of this in action?