gpt4 book ai didi

.htaccess - 403重定向不起作用

转载 作者:行者123 更新时间:2023-12-04 05:56:39 30 4
gpt4 key购买 nike

如何强制 apache 重定向到 403 错误?
我试过了:

RewriteRule ^forbid/(.*)$ / [R=403,L] 

这导致整个站点出现 500 个服务器错误
RewriteRule ^forbid/(.*)$ - [R=403,L] 


RewriteRule ^forbid/(.*)$ [R=403,L] 

这些根本行不通
我有以下 .htaccess 文件:
RewriteEngine on
RewriteRule ^(config|backup)(.*)$ - [F] [NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^admin/(.*)$ /admin/index.php?%{QUERY_STRING} [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !util
RewriteRule ^(.*)$ index.php?%{QUERY_STRING} [L,QSA]

请帮我!

最佳答案

试试这个:

RewriteRule ^forbid/(.*)$ - [F]

来源: http://httpd.apache.org/docs/current/rewrite/flags.html#flag_f

关于.htaccess - 403重定向不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6032059/

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