Tuesday, October 26, 2021

[SOLVED] The urls on Laravel working locally but not working on AWS EC2 linux centos 7

Issue

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?


Solution

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



Answered By - Omran Al_haddad