gpt4 book ai didi

apache - 没有 RewriteCond 的 htaccess RewriteRule 不起作用

转载 作者:行者123 更新时间:2023-12-03 22:47:19 24 4
gpt4 key购买 nike

为什么这样做:

Options +ExecCGI
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.fcgi/$1 [L]

但如果我远程 RewriteCond它不起作用,我收到内部服务器错误。
Options +ExecCGI
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteRule ^(.*)$ /app.fcgi/$1 [L]

如果我修改 RewriteCond例如像这样它也不起作用。
RewriteCond %{REQUEST_FILENAME} !-l

我要重定向 全部 对 app.fcgi 的请求。我不希望用户能够直接访问文件。

提前致谢!

最佳答案

它给你内部服务器错误 (500) 因为没有 RewriteCond你的循环是无限循环的。

您可以使用此规则来防止这种情况:

Options +ExecCGI
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteRule ^((?!app\.fcgi/).*)$ /app.fcgi/$1 [L,NC]
(?!app\.fcgi/)负前瞻如果请求已经是 /app.fcgi/,则阻止此重写规则执行.

关于apache - 没有 RewriteCond 的 htaccess RewriteRule 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27200626/

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