Laravel Routing Does not Work -
i new in laravel framework , want run controller function of view page
class testcontroller extends basecontroller { public function index() { homecoming view::make('hai'); } } i set routing in routes.php file given below
route::get('test','testcontroller@index'); i tried run in mozilla with
localhost/laravel/public/test but shows
not found requested url /laravel/public/test not found on server. is there problem in .htaccess page ?
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] # handle front end controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] </ifmodule> any body please help me.
i'm assuming on ubuntu machine. create work, @ first, enable rewrite module executing next command in terminal
sudo a2enmod rewrite second, find "apache2.conf" file in system, mine located in
/etc/apache2/apache2.conf in file, find next snippets of code:
<directory /var/www/> options indexes followsymlinks allowoverride none require granted </directory> change "allowoverride none" "allowoverride all". save file , restart apache server executing next command
sudo service apache2 restart this should solve issue. cheers
laravel laravel-routing
No comments:
Post a Comment