gpt4 book ai didi

php - .htaccess 未重定向/to/index.php

转载 作者:行者123 更新时间:2023-12-02 04:29:02 25 4
gpt4 key购买 nike

我正在使用位于development.local/web/目录中的htaccess代码,将我的所有路径重定向到development.local/web/index.php文件。

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /web
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>

现在,我有development.local/web/作为我的基本URL。因此,所有路径都必须重定向到development.local/web/index.php,现在所有网址都将正确重定向,除了development.local/web/,这给了我一个503禁止错误。

最佳答案

很可能您没有设置 DirectoryIndex

将其保留在您的 .htaccess 中:

DirectoryIndex index.php
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

关于php - .htaccess 未重定向/to/index.php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24662883/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com