为什么我的网站显示的目录索引我的网站不是实际的网站


Why is my website showing the directory index of my site not the actual site?

我撕裂我的头发在这里,但我的网站是显示我的网站内容的列表,而不是网站本身在我的现场网站。.htaccess是我在所有的laravel构建中总是使用的。

. htaccess :

# The htaccess file
RewriteEngine On
RewriteCond %{HTTP_HOST} ^{yoursite}.{extension} [NC]
RewriteRule (.*) http://www.{yoursite}.{extension}/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

当我去访问站点根目录时,出于某种原因,我只得到一个文件列表,而不是读取/public/文件夹中的index.php文件。

谁能建议修复这个?

听起来该目录没有启用PHP。确保您的虚拟主机配置正确,并且PHP已启用mod_rewrite。