Lynx
Lynx

Reputation: 1482

Laravel 403 Forbidden when uploading site

I have uploaded my site to 1and1 (for a client not my choice) and I had to put the website in a subfolder off of root so basically:

-/
 -/subfolder
   -/app
   /vendor
   /public
   /everything else laravel has

and I successfully edited the domain to point to the public folder.

However, when I try to go to www.website.com it returns an 403 forbidden error. I can go to other pages www.website.com/coolstuff with zero issues. I can even pull up the home page by typing www.website.com/index.php

So, I thought it was my .htaccess file and I edited it according to other peoples issues related to 1and1 and laravel and I still get the same problem.

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

RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

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

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
</IfModule>

So not sure of another way to edit this to get it to work. Or, if it could be another issue or setting within 1and1.

Upvotes: 1

Views: 2821

Answers (1)

Panama Jack
Panama Jack

Reputation: 24448

Put this at the top of your .htaccess file and see how it works for you.

DirectoryIndex index.php

Typically when you can access the index file directly but you can't without specifying it, your apache config may not have a directory index specified for index.php. So you will get a 403 forbidden because directory indexing is turned off and it thinks you don't have an index file.

Upvotes: 2

Related Questions