Web Dev

How to set up a cron job on a site that's protected with .htaccess/.htpasswd?

To set a cron job on a website which is protected with .htaccess/.htpasswd password protection,

instead of setting cron job as

wget -O - -q -t http://www.example.com/cron.php

or

curl --compressed http://example.com/cron.php

Set the cron job as below

curl -u admin:PassworD --silent --compressed http://www.example.com/cron.php

In the above cron, we have specified  .htaccess /.htpasswd protection. details where username is admin and password is PassworD

That's all..

Abhijit Sandhan

Love to Automate, Blog, Travel, Hike & spread Knowledge!

Related Articles

One Comment

Leave a Reply to sandesh Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button