gpt4 book ai didi

.htaccess -> 域参数 -> https ://example. com/page 正在工作,而 https ://example. com/没有

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

我的 .htaccess 文件有问题。我将随时添加具有当前域的参数。它确实适用于 https://example.com/page但不适用于 https://example.com/
我当前的 .htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?domain=%{HTTP_HOST}&page=$1 [L,QSA]
我已经尝试过 .* 和 .在 RewriteRule 而不是 ^(.*)$

最佳答案

使用您显示的示例,只需添加检查您的 Uri 的条件,然后使用 index.php 为其提供服务。你能不能试试以下。在测试您的 URL 之前,请确保清除浏览器缓存。

RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?domain=%{HTTP_HOST}&page=$1 [L,QSA]

RewriteCond %{REQUEST_URI} ^/?$
RewriteRule ^ /index.php?domain=%{HTTP_HOST} [L]

关于.htaccess -> 域参数 -> https ://example. com/page 正在工作,而 https ://example. com/没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66001445/

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