I have an angular app that works perfectly in localhost. I uploaded to a server and the layout-blade works perfectly, but it can not find the index page that goes in the ng-view. It just returns a 404 error.
Here is the approutes.js
angular.module('appRoutes', []).config(['$routeProvider','$locationProvider', '$httpProvider',function ($routeProvider, $locationProvider, $httpProvider) {
$routeProvider
.when('/', {
templateUrl: '/partials/index',
controller: 'MainController'
})
The index is in /resources/views/partials
The layout blade is in /resources/views
The head of that html has
I am in an apache2 server in an ubuntu machine.
Any ideas?
edit: This is my .htacess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /1ドル [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
-
If it works local with pretty url's it's because you configured local to always serve app entry point.charlietfl– charlietfl2016年07月14日 16:07:10 +00:00Commented Jul 14, 2016 at 16:07
-
I am using a bolierplate so I did not configure anything. Any help on how to configure local or app entry point will really helpuser3474502– user34745022016年07月14日 16:13:05 +00:00Commented Jul 14, 2016 at 16:13
-
basically need mod rewrite which can put in htaccess. Should be easy to searchcharlietfl– charlietfl2016年07月14日 16:15:13 +00:00Commented Jul 14, 2016 at 16:15
-
I just added my htaccess but I do not know how to rewrite it or even if I have touser3474502– user34745022016年07月14日 16:25:12 +00:00Commented Jul 14, 2016 at 16:25
-
That redirect makes it possible to load the index.php which loads the layoutblade, which is working. The problem is that it is not loading the rest of the partial views in the angular route serviceuser3474502– user34745022016年07月14日 16:28:50 +00:00Commented Jul 14, 2016 at 16:28
2 Answers 2
In your root directory make a file named .htaccess and following code to that file
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# not rewrite css, js and images
RewriteCond %{REQUEST_URI} !\.(?:css|js|map|jpe?g|gif|png)$ [NC]
RewriteRule ^(.*)$ /index.html?path=1ドル [NC,L,QSA]
Comments
I just fixed by changing the AllowOverride None to AllowOverride All. That did that trick. Thanks
Comments
Explore related questions
See similar questions with these tags.