【发布时间】:2017-12-09 22:09:27
【问题描述】:
我想在 godaddy 上上传我本地的 Laravel 项目,但我遇到了一些错误
错误
[Wed Jul 05 21:16:44.858396 2017]
[autoindex:error] [pid 21796:tid 139689709188864]
[client 99.240.235.234:57754]
AH01276:
Cannot serve directory /home/bugsbunny/public_html/sto.com/:
No matching DirectoryIndex (/home/bugsbunny/public_html/sto.com/public/index.php)
found, and server-generated directory index forbidden by Options directive
.htaccess
DirectoryIndex /home/bugsbunny/public_html/sto.com/public/index.php
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /home/bugsbunny/public_html/sto.com/public/index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
我做过的步骤
- 我编辑了 public/.htaccess 文件
- 编辑的意思是改变第一行的目录和以
RewriteRule开头的行 - 我将此文件剪切并粘贴到根目录中
- 我把项目上传到了godaddy
【问题讨论】:
标签: laravel .htaccess laravel-5