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
Route::get('/contact', 'ContactController@index')->name('contact.index');
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.
if you are using 2nd method(apache) try this.
sudo a2enmod rewrite
sudo service apache2 restart
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.