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 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类