php - 404 issue with Laravel route -
i confused why happening here issue guys. building app using laravel4 want go url
http://app.tld/books however error every time:
404: requested url /books not found on server. however in routes.php file have route defined:
route::get('/books', 'bookcontroller@index'); i have view , relevent method in controller:
public function index(){ $books = book::all(); return view::make('book.index')->with('books', $books); }
from comments gather apache issue, not laravel issue (mod_rewrite wasn't enabled -- kudos @watcher), , i'm glad sorted out.
for future reference, seemed apache issue because laravel throws php exceptions on undefined routes, namely symfony \ component \ httpkernel \ exception \ notfoundhttpexception. if have debug set true you'll neatly styled stack trace code highlighting , server/request data, if not you'll neatly styled "whoops, looks went wrong." message. if, on other hand, white screen times new roman messages "404: requested url /books not found on server.", laravel isn't starting up.
as comments on question show, there many other clues tell it's not laravel routes, though code posted , title of question, seemed had narrowed down routes, had looking in wrong place while.
Comments
Post a Comment