Ad

The Urls On Laravel Working Locally But Not Working On AWS EC2 Linux Centos 7

When I click on login button on my website, its go to http://example.com/login? which is expected but the page Not Found. But if i go to http://example.com/index.php/login? manually, then will go to the correct page "login page".

In my localhost its working properly when I click the login button.

  • I had wrote this command on storage folder chmod -R 777 storage.

I am not sure if this is the case, do I need to write this command on another folders?

Ad

Answer

Its fixed :)

  • I had to go to cd etc/httpd/conf

  • Next, edit httpd.conf by sudo vim httpd.conf, and add this at the end of the file:

    <Directory "/var/www/html/your/laravel-project-folder/"> AllowOverride All </Directory>

-Then restart the server sudo systemctl restart httpd.service

Ad
source: stackoverflow.com
Ad