这是我第一次尝试在我的共享主机账户上部署我的Laravel应用程序。
文件夹结构如下:
|--laravel
|--app
|--GoPublic.php // use to point to new location
|--bootstrap
|--config
|--database
// more folders
|--public_html
|--app // my subdomain document root
|--assets
|--index.php // GoPublic.php point to this file
当我转到我的子域url时,我得到的是:
我已经检查了我的error.log文件,我得到了下面的403禁止错误:
[autoindex:error] [pid 910782] [] AH01276: Cannot serve directory /home/user/public_html/app/: No matching DirectoryIndex (index.php,Index.html,Index.htm,index.html.var,index.htm,index.html,index.shtml,index.xhtml,index.wml,index.perl,index.pl,index.plx,index.ppl,index.cgi,index.jsp,index.js,index.jp,index.php4,index.php3,index.phtml,default.htm,default.html,home.htm,index.php5,Default.html,Default.htm,home.html) found, and server-generated directory index forbidden by Options directive
希望有谁能帮我。谢谢!
发布于 2019-12-17 15:54:15
也许现在回答已经晚了,但请确保您对您的public/index.php
文件具有正确的权限。例如,如果您的用户是核心,那么您也应该将其设置为index.php
的所有者。
要更改它,可以使用以下命令:
sudo chown -R core public/index.php
发布于 2016-05-04 04:03:21
您可以尝试在laraval
目录和laravel/public
目录中添加.htaccess
。
<IfModule mod_rewrite.c>
WriteEngine On
RewriteBase /laravel/public/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
也许您还需要将Laravel指向一个公共目录才能使其工作。例如,如果您在/path_to_laravel/public/
目录中安装了Laravel,则需要在您的Apache配置中使用以下设置:
DocumentRoot "/path_to_laravel/public/"
<Directory "/path_to_laravel/public/">
在此之后,重启Apache,您的应用程序应该会按预期工作。
https://stackoverflow.com/questions/37012303
复制相似问题