ehm...
Why not start by giving us some more information, without that you cannot help yourself and we can't help you...
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How to solve 403 forbidden error in laravel project ??
ehm...
Why not start by giving us some more information, without that you cannot help yourself and we can't help you...
@MThomas When i upload my laravel app to the server it is showing 403 Forbidden error. But it is perfectly working in the localhost. I am getting this error in error log : File not found [/home/anandmainali/public_html/403.shtml].
If you use Vesta CP on your VDS then this may help https://gist.github.com/m4tlch/5ddba908a5cde3f937fc7ddf6a9725f9 - it is templates for Laravel projects to avoid 403 error when root folder is not /public
@anandmainali5 , Can you check the Storage/logs folder for Clear error. It will help you to figure out exact problem.
Also check your domain exactly mapping to Public folder.
check your .htaccess file
@saravana2906 can you provide me .htaccess code to solve this problem??
As per my understanding, you are trying to access root folder instead of public folder in server.
@Saikishore I am using the same .htaccess code and it works perfectly. But in this project i am getting this 403 error.
My .htaccess code is as below. it is working fine on local but not on server. showing 403 forbidden error. i tried to change permission for .htaccess still it is not working. please suggest some solution
Options -MultiViews -IndexesRewriteEngine 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]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
#RewriteCond %{HTTPS} on
#RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
I have setup a laravel project and created a subdomain to point that folder. Everything works well except that when i visit that subdomain in another tab, it throws 403 forbidden. I cant even access the htaccess file.
Please or to participate in this conversation.