Laravel 403上传网站时禁止使用

时间:2015-01-14 03:18:36

标签: php .htaccess laravel

我已经将我的网站上传到1and1(对于不是我选择的客户端)而且我必须将网站放在root下的子文件夹中,所以基本上:

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

我成功编辑了域以指向公用文件夹。

然而,当我尝试转到www.website.com时,它会返回403禁止错误。我可以零问题转到其他页面www.website.com/coolstuff。我甚至可以通过输入www.website.com/index.php

来提取主页

所以,我认为这是我的.htaccess文件,我根据与1and1和laravel相关的其他人的问题编辑了它,我仍然遇到同样的问题。

<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>

所以不确定另一种方法来编辑它以使其工作。或者,如果它可能是1和1内的另一个问题或设置。

1 个答案:

答案 0 :(得分:2)

将它放在.htaccess文件的顶部,看看它是如何工作的。

DirectoryIndex index.php

通常,当您可以直接访问索引文件但无法指定索引文件时,您的apache配置可能没有为index.php指定的目录索引。因此,您将获得403禁止,因为目录索引已关闭,并且它认为您没有索引文件。

相关问题