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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料