【发布时间】:2019-12-19 20:40:25
【问题描述】:
我在子文件夹中设置 laravel 5.6,但它给出错误页面没有正确重定向。我已经用 htaceess 尝试了一切。我已经在根文件夹和公用文件夹中设置了 htacess,但它不工作 我的根 htaccess 是
<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 ^ index.php [L]
</IfModule>
这是我的公用文件夹的 htacess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /charity-frontmode/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
请帮忙!提前致谢
【问题讨论】:
-
您尝试过使用 Apache VirtualHost 吗? httpd.apache.org/docs/2.4/vhosts/examples.html
-
是的,但我在我的开发服务器上设置它,所以无法设置虚拟主机