admin管理员组文章数量:1389779
I'm currently working on a production site where htaccess is blocking users that do not have my IP from accessing the site:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^11.22.33.44
RewriteCond %{REQUEST_URI} !^/brb/(.)*$ [NC]
RewriteRule ^(.*)$ /brb/index.html [R=307,L]
Maintenance mode, basically.
I've now realized, WP Crons are not running. And I'm trying to force them to run (WP Cron Control plugin) by selecting "run now". They're all stuck at "Running: (now)" but never execute.
I assume it has something to do with the htaccess, but do not know how to make an exception for wp-crons without allowing in all public traffic for a moment?
I'm currently working on a production site where htaccess is blocking users that do not have my IP from accessing the site:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^11.22.33.44
RewriteCond %{REQUEST_URI} !^/brb/(.)*$ [NC]
RewriteRule ^(.*)$ /brb/index.html [R=307,L]
Maintenance mode, basically.
I've now realized, WP Crons are not running. And I'm trying to force them to run (WP Cron Control plugin) by selecting "run now". They're all stuck at "Running: (now)" but never execute.
I assume it has something to do with the htaccess, but do not know how to make an exception for wp-crons without allowing in all public traffic for a moment?
Share Improve this question asked Apr 10, 2020 at 21:37 yesbutmaybenoyesbutmaybeno 1655 bronze badges1 Answer
Reset to default 3The .htaccess
directives block any HTTP request not coming from your IP address. However, I believe WP Cron is also an HTTP request that originates from the server. So, you need to also make an exception for the server's external IP address.
These directives can also be simplified a bit...
For example:
RewriteCond %{REMOTE_ADDR} !=203.0.113.111
RewriteCond %{REMOTE_ADDR} !=11.22.33.44
RewriteRule !^brb/ /brb/index.html [R=307,L]
Where 203.0.113.111
is whatever your server's IP address is.
The =
operator on the CondPattern makes it a lexicographical string comparison, as opposed to a regex, so no need for the start-of-string anchor (^
) or escaping of literal dots (which you aren't doing anyway, but strictly should be).
No need for the additional condition that checks that the URL-path does not start /brb/
, since this can be incorporated into the RewriteRule
pattern. (And no need for the capturing groups, since you don't have any backreferences.)
本文标签: Temporary htaccess blocking is disabling WP Crons from running
版权声明:本文标题:Temporary .htaccess blocking is disabling WP Crons from running? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744578947a2613799.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论