When project is in local. This view can be seen from putting url “localhost/contact “. But
When the project is in production server , “Not Found
The requested URL /contact was not found on this server.” Is displayed.
How can I solve this problem. Thanks
This could be due to many issues. I would suggest you to check whether your .htaccess is defined correctly and you have enabled mod_rewrite in your server. The method for this differs based on your server whether its Apache or Nginx. Follow the method suggested in the official documentation as in the image below.
If you are using Apache server, don’t forget to run the following commands to enable mod_rewrite and restart apache.
sudo a2enmod rewrite sudo systemctl restart apache2
You can run a laravel project in two ways.
- php artisan serve (Development server)
- using apache server (localhost/project_folder/public/)
if you are using 2nd method(apache) try this.
sudo a2enmod rewrite
sudo service apache2 restart