php - able to access only the / route in Laravel 5.2 -
i able access '/' route , other routes returning 404.
i have installed laravel on new ec2 instance , have ensured php, mysql , apache2 running
my laravel version 5.2.45
my 000-default.conf follows
<virtualhost *:80> serveradmin webmaster@localhost documentroot /var/www/html/testing/public errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined </virtualhost>
my apache2.conf file follows
<directory /> options followsymlinks allowoverride none require denied </directory> <directory /usr/share> allowoverride none require granted </directory> <directory /var/www/html/testing/public> options indexes followsymlinks allowoverride none require granted </directory>
my folder structure /var/www/html/testing
but getting 500 when trying hit ip..any highly appreciated.
routes.php
**********physiotherapist******/ route::get('/home-request/physiotherapist', 'homecontroller@physiotherapist'); route::post('/physiotherapist', 'servicescontroller@requestphysio'); route::post('/physiotherapist/getphysiorates', 'servicescontroller@getphysiorates'); /********** doctor *************/ route::get('/home-request/doctor', 'homecontroller@doctor'); route::post('/doctor', 'servicescontroller@requestdoctor'); route::post('/doctor/getdoctorrates', 'servicescontroller@getdoctorrates'); /********** patient attendant *************/ route::get('/home-request/patient-attendant', 'homecontroller@patient'); route::post('/patient', 'servicescontroller@requestattendant'); route::post('/patient/getpatientattendantrates', 'servicescontroller@getpatientattendantrates');
/public/.htaccess file
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on options -indexes rewritecond %{request_filename} !-f rewriterule ^([^\.]+)$ $1.php [nc,l] # rewriterule ^([^\.]+)/([^\.]+)$ /$2.php [l] # redirect trailing slashes if not folder... rewritecond %{request_filename} !-d rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] # handle authorization header rewritecond %{http:authorization} . rewriterule .* - [e=http_authorization:%{http:authorization}] </ifmodule> <ifmodule mod_expires.c> expiresactive on addtype image/x-icon .ico expiresbytype image/gif "access plus 60 days" expiresbytype image/jpeg "access plus 60 days" expiresbytype image/png "access plus 60 days" expiresbytype image/ico "access plus 60 days" expiresbytype image/x-icon "access plus 60 days" expiresbytype text/css "access plus 60 days" expiresbytype application/javascript "access plus 60 days" expiresbytype application/x-javascript "access plus 60 days" expiresbytype text/javascript "access plus 60 days" expiresbytype application/json "access plus 7 minutes" </ifmodule> ## expires caching ## <ifmodule mod_deflate.c> # compress html, css, javascript, text, xml , fonts addoutputfilterbytype deflate application/javascript addoutputfilterbytype deflate application/rss+xml addoutputfilterbytype deflate application/vnd.ms-fontobject addoutputfilterbytype deflate application/x-font addoutputfilterbytype deflate application/x-font-opentype addoutputfilterbytype deflate application/x-font-otf addoutputfilterbytype deflate application/x-font-truetype addoutputfilterbytype deflate application/x-font-ttf addoutputfilterbytype deflate application/x-javascript addoutputfilterbytype deflate application/xhtml+xml addoutputfilterbytype deflate application/xml addoutputfilterbytype deflate font/opentype addoutputfilterbytype deflate font/otf addoutputfilterbytype deflate font/ttf addoutputfilterbytype deflate image/svg+xml addoutputfilterbytype deflate image/x-icon addoutputfilterbytype deflate text/css addoutputfilterbytype deflate text/html addoutputfilterbytype deflate text/javascript addoutputfilterbytype deflate text/plain addoutputfilterbytype deflate text/xml header append vary user-agent </ifmodule>
you need allow override in appache conf. try this:
<directory /var/www/html/testing/public> options indexes followsymlinks allowoverride require granted </directory>
Comments
Post a Comment