Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ved21212's avatar

Forbidden You don't have permission to access this resource. - Production

Hello Team, I am trying to deploy my project to live using contaboserver but getting Forbidden You don't have permission to access this resource. Can you help me solve this...?

I also renamed server.php to index.php

This is my .htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ / [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php71” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php71 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

0 likes
4 replies
koes's avatar
  • Check your webserver configuration. Is it configured properly with correct path to your public/ folder.
  • Check your files mode & owner. Does your webserver have access to your files.
Ved21212's avatar

How do I check that this is the first time I am deploying my project to live server @koes

Ved21212's avatar

I checked the permission though it was 750. How do i check is webserver has access to the files @koes

koes's avatar

I think you put a wrong path for web server DocumentRoot. You should point your webserver DocumentRoot to your public/ folder, not your laravel root folder. You don't have to rename server.php into index.php, because server.php is only used for development, when you run php artisan serve.

Check your hosting configuration again, make sure it pointed to public/.

Please or to participate in this conversation.