Sebi.E
Sebi.E

Reputation: 124

Laravel 5 Error 403 forbidden access webhosting

I wanted to deploy my Laravel 5 App on the webhost one.com

I followed along some tutorials on the internet and moved my puplic folders content into the root folder of the host and made the required path changes to the index.php file. But now I've got the

403 Error: You don't have permission to access / on this server.

I believe it's because of my .htaccess file:

Options -MultiViews

RewriteEngine On

DirectoryIndex public/index.php

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

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

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

I'm new to .htaccess files and maybe you guys can help me! :)

Upvotes: 1

Views: 4025

Answers (1)

Dygnus
Dygnus

Reputation: 641

The 403 forbidden status you have, can be triggered by many things. I hope you get started by checking the following:

Create (or access) an existing file with your document root. Is this file accessible? If accessible, something in your .htaccess is off. If not accessible, probably not access is granted (yet), please add to your .htaccess:

Require all granted

When the test file is still not accessible, this could be a side effect of the 'Redirect Trailing Slashes If Not A Folder', please change this to:

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

Another addition to your .htaccess could also solve the issue:

RewriteBase /

Let me know if (or not) your issue is resolved.

Upvotes: 1

Related Questions