admin管理员组文章数量:1279206
I want to add 'rewrite condition' in .htcaccess but unfortunately I don't have access of that. Can I write conditions in functions.php ? If yes, how to achieve that ? I want to add these lines:
RewriteCond %{QUERY_STRING} ^.{1000,}$
RewriteRule ^wp-admin/load-scripts\.php$ - [F]
I want to add 'rewrite condition' in .htcaccess but unfortunately I don't have access of that. Can I write conditions in functions.php ? If yes, how to achieve that ? I want to add these lines:
RewriteCond %{QUERY_STRING} ^.{1000,}$
RewriteRule ^wp-admin/load-scripts\.php$ - [F]
Share
Improve this question
edited Sep 22, 2021 at 13:02
Ricky
asked Sep 22, 2021 at 8:53
RickyRicky
538 bronze badges
8
|
Show 3 more comments
1 Answer
Reset to default 1use this https://wordpress/plugins/wp-htaccess-editor/, if you are not willing to use any plugin, understand the code and implement in functions.php or your own custom plugin. cheers.
本文标签: Can I write 39RewriteCond39 using 39functionsphp39
版权声明:本文标题:Can I write 'RewriteCond' using 'functions.php'? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741298234a2370941.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
f
at the end should be[F]
. Is theRewriteRule
pattern intentionally uppercase? – MrWhite Commented Sep 22, 2021 at 9:40RewriteRule ^wp-admin/load-scripts\.php$ - [NC,F]
. The rule as written (all uppercase and noNC
flag) would fail to match the request it is trying to block. TheNC
flag would be required if you are running this on a Windows platform. And the lonef
at the end would trigger an immediate 500 Internal Server Error (since it's entirely invalid syntax). – MrWhite Commented Sep 22, 2021 at 12:09.htaccess
file. If you don't have permission to edit.htaccess
(or there is no.htaccess
) file then this isn't going to be possible. (Has this vulnerability not already been "fixed" inload-scripts.php
?) – MrWhite Commented Sep 22, 2021 at 13:36