gpt4 book ai didi

.htaccess - htaccess 排除特定目录

转载 作者:行者123 更新时间:2023-12-03 08:16:35 25 4
gpt4 key购买 nike

我的网站根目录有一个 htaccess,如下所示:

RewriteEngine On

RewriteRule \.php$ - [L,NC]

RewriteRule ^(?:favicon\.ico|(?:index|custom500|custom404)\.html)$ - [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .+ index.php?source=$0 [L,QSA]

我希望它忽略那些包含特定文件夹 folder1 的 URL。网址将类似于:

https://mycooldomain.com/folder1/api/rest/... //something else here

我已经检查过this question但我似乎无法将其应用到我的情况。

最佳答案

像这样:

RewriteEngine On

# ignore request URLs that start with /folder1/
RewriteCond %{THE_REQUEST} \s/+folder1/ [NC]
RewriteRule ^ - [L]

RewriteRule \.php$ - [L,NC]

RewriteRule ^(?:favicon\.ico|(?:index|custom500|custom404)\.html)$ - [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .+ index.php?source=$0 [L,QSA]

关于.htaccess - htaccess 排除特定目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69197835/

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