duanguanzai6181 2015-01-14 03:18
浏览 191
已采纳

Laravel 403上传网站时禁止使用

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.

  • 写回答

1条回答 默认 最新

  • dongye4192 2015-01-14 03:44
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 MATLAB动图的问题
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名