PHP 7.4.9
Laravel 7.20.0
Appache 2.4.6
RedHat 7
I deployed my laravel project on the server and I am receiving the below error:
Not Found
The requested URL /login was not found on this server.
I tried almost all solutions that i found online.
The problem stayed the same.
mod_rewrite is enabled.
I added multiple line to httpd.conf and fix DocumentRoot
/etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/chatbot/public"
<Directory "/var/www/html/chatbot/public">
AllowOverride All
</Directory>
/var/www/html/chatbot/public/htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Please note that when i try to link the DocumentRoot to a new laravel project, it works fine, but for the deployed code its not working(receiving the above error).
Public folder:
2
Answers
My problem was so silly. i Changed the folder name from:
To:
laravel doc:
read more
after this apply and restart your apache server