Cron Job for HTTPS

Hello, my website has an SSL certificate. I force redirect traffic to HTTPS with .htaccess file. i want to add Cron Job in Infinityfree client area. Wich URL should i choose? HTTP or HTTPS? In Infinityfree and my Wordpress panel, HTTP is my base URL and i just force trafic to HTTPS with some commands in .htaccsess.

HTTPS? I thought that question should answer itself.

You should add the Cron job for HTTPS and change your Wordpress settings to use the HTTPS scheme (change the http:// prefix to https://).

4 Likes

thank you for your answer. But my Cron Job is working with HTTP too and say “OK”. It is important to change that to HTTPS?

If it’s working, well, “don’t fix something that ain’t broke”.
(If it’s working, don’t change it)

5 Likes

I thought the same. But I’m not sure. Can I create two Cron Job with different URLs? Example: http://address.com and https://address.com at same time.

If you want to, there’s no-one/nothing stopping you.

3 Likes

So there is no problem? For example, won’t my website get confused? :)))

That’s for you to find out :wink:
Why would you want to do that, though? We don’t have any idea how your website will react. It depends on what the cron job does, and needs. This post in StackExchange security - Cron not working after forcing https - CiviCRM Stack Exchange features one issue that may come up if you point the cron to HTTP instead of HTTPS, for example.

5 Likes

I want to make sure it works perfectly. :grin:

It would be best to point it to the HTTPS version of your website then, since you’re redirecting all traffic to that.

6 Likes

Thank You :heart:

1 Like

If all traffic uses HTTPS, you must use HTTPS for the cron job.

Our cron jobs don’t follow redirects. So if you point it to the HTTP URL, you’ll see cron job logs saying that the a redirect was returned pointing to HTTPS. But the actual HTTPS URL will not be called.

5 Likes

Thank you for your support :heart:

Can i set HTTP and HTTPS URL at same time?

Yes, you can setup both! You can create a cron job for HTTP and one for HTTPS.

I don’t see why you would do that, as I’m sure one URL works and another doesn’t, and setting up a cron job which doesn’t do anything isn’t particularly helpful, but you can do it.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.