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

etekumoses's avatar

403 Forbidden Access to this resource on the server is denied!

Hey devs I have been working on localhost and when i tried to deploy it to laravel i get this error i even gave permissions to storage folder but all in vain. someone who has any way to go past this thanks. this is my .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]

# cors
Header set Access-Control-Allow-Origin "*"

Hide a specific file

<Files .env> Order allow,deny Deny from all </Files> RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-SSL} !on

0 likes
12 replies
vincent15000's avatar

Here is my .htaccess file.

<IfModule mod_rewrite.c>

    RewriteBase /

    <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>
1 like
vincent15000's avatar

@etekumoses You didn't say that you have a CPanel.

When do you have this error ?

Have you generated the app key ?

etekumoses's avatar

@vincent15000 I am able to load the site(Authentication screen/login) but when i try to submit data i get the error

1 like
etekumoses's avatar

@vincent15000 Yes its there look at this sample just to show

@csrf
                        <div class="text-center">
                            <div class="mb-5">
                                <h1 class="display-4"> {{\App\CentralLogics\translate('sign_in')}}</h1>
                                <p>Please fill in the details to proceed
                                </p>
                            </div>
                            
                        </div>

...............................................................................

1 like

Please or to participate in this conversation.