.htacess rule to use cron task without CF 524 timeout

Hi! =)

I have CF 524 error page on my cron task results.
Regarding the FAQ, i’ve created a subdomain: cron.exemple.com
Now i’m trying to execute by this subdomain not proxied by CF (:grey:).
But i still have a redirection rule in my .htacess from cron to www subdomain.

This is a sample of my prestashop htacess:

RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule . - [E=HTTP_AUTHORIZATION:%1]

#Domain: www.exemple.com
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] 

I found this rule:

RewriteCond %{HTTP_HOST} !^(foo|bar)\.example\.com$ [NC]

But i dont know how to use it with my actual configuration… =(

Does this mod is secure for the rest of the shop?
Just need to target a specific URL to execute a backup ^^
Do i need to use “CF security access” option ?

Thank for your help!

The best advice might be to rework that entire approach, not to depend on an HTTP call for the execution of a local and internal function.

1 Like

Seams great.
Better ask crontab to execute local command or php script without calling an url ?
Is that?

Yes, exactly. Executing that via a direct/native call is definitely the better choice and less error prone than depending on an HTTP call.