【发布时间】:2023-03-31 17:17:02
【问题描述】:
我正在尝试将 Laravel 项目部署到共享主机上,我已经设法完成了大部分艰苦的工作,但我无法在没有 Forbidden 问题的情况下剥离 /public 目录。
网站工作并显示这些链接的相同页面
- www.mywebsite.com/test/index.php
- www.mywebsite.com/test/public/
但没有 /index.php 它返回 ->
Forbidden
You don't have permission to access /test/ on this server.
目前我的 .htaccess 如下所示。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ public/index.php [L]
</IfModule>
有什么想法吗?
【问题讨论】:
-
所以
www.mywebsite.com/test/public/有效但www.mywebsite.com/test/无效? -
www.mywebsite.com/test/index.php 虽然有效,但我认为我的 .htaccess 有问题
标签: php apache .htaccess mod-rewrite laravel