gpt4 book ai didi

html - 如何从重写规则中排除特定文件

转载 作者:技术小花猫 更新时间:2023-10-29 12:36:27 26 4
gpt4 key购买 nike

我来过这里:How to exclude a specific file in htaccess

这里:exclude files from rewrite rule in .htaccess

但都没有用。我可能做错了什么?

.htaccess 文件:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^wp-content(/.*|)$ - [L] # don't take any action
RewriteRule ^wp-admin(/.*|)$ - [L] # don't take any action
RewriteRule ^wp-includes(/.*|)$ - [L] # don't take any action
RewriteCond %{REQUEST_URI} !^/pureplantessentials\.html$

RewriteRule ^moreinfo/(.*)$ http://www.kgstiles.com/moreinfo$1 [R=301]
RewriteRule ^healthsolutions/(.*)$ http://www.kgstiles.com/healthsolutions$1 [R=301]
RewriteRule ^(.*)\.html$ $1/ [R=301]
RewriteRule ^(.*)\.htm$ $1/ [R=301]
</IfModule>

最佳答案

要排除文件,请尝试这样的操作:

RewriteCond %{REQUEST_URI} !^/pureplantessentials\.html$ 

如果文件是 pureplantessentials.html,将跳过该规则。

关于html - 如何从重写规则中排除特定文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14008003/

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