Laravel 5 Routes not working

Status
Not open for further replies.

merzonit

New Member
Messages
9
Reaction score
0
Points
1
I have created a new account and installed the Laravel framework. The primary url http://merzonitsolutions.x10host.com/ works properly, presents the initial Laravel screen and redirects properly to the default test page.

I have created a route, which should work against the url http://merzonitsolutions.x10host.com/users . I get a 404 error on this url. Altering the code to make the users view the default page works (ie the users view is a valid view). Other created routes also result in a 404.

Several articles including this one http://laravel.io/forum/06-11-2014-not-found-but-route-exists indicate that the issue lies within the file httpd.conf. The line specifying Allowoveride for my Document Root should be set to All.

I cannot find httpd.conf or any similar file in my site directory. The article further states that once the httpd.conf is updated, httpd services should be restarted. I assume this is at server level and would require the aid of an X10Hosting administrator.

I'm sure that other Laravel 5 users have run across this. Please advise.

Thanks for your assistance!

Steve
 
Last edited:

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi Steve,

The "AllowOverride" server option allows our users to specify .htaccess files. We already have this enabled on all free hosting accounts, so this should not be an issue. This is most likely a problem with the .htaccess file on your account. ;)

Thank you,
 

merzonit

New Member
Messages
9
Reaction score
0
Points
1
Dead-i,

Thank you for checking the configuration and getting back to me. I now have it working. There are two changes from a stock install for it to work.

By default, the .htaccess file is placed in the public folder. This file needs to be moved up to the root itself. Within the file, the rewrite command adds "index.php" to the url. This needs to be amended to /public/index.php. Once these two changes are made, the .htaccess file is processed and the url is rewritten to access the index.php within public which loads the Laravel environment and processes the routes.

I hope this helps other people with the same issue down the road.

Steve
 
Status
Not open for further replies.
Top