本文介绍了Cronjob与密码保护网站(.htaccess)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个cronjob,每X次打开一个网页。
I want to create a cronjob that every X time goes to open a webpage.
此网页受密码保护.htaccess(user = admin,passwor = pass )。我给出的指令如下:
This webpage is password protected by .htaccess (user=admin, passwor=pass). The instruction I give is the following:
wget --user=admin --password='pass' www.mywebsite/test.php但是cron给我以下错误:
But cron gives me the following error:
--2012-05-02 10:14:01-- www.mywebsite/test.php Resolving www.mywebsite... IP Connecting to www.mywebsite|IP|:80... connected. HTTP request sent, awaiting response... 401 Authorization Required Reusing existing connection to www.mywebsite:80. HTTP request sent, awaiting response... 403 Forbidden 2012-05-02 10:14:01 ERROR 403: Forbidden.我也尝试了:
wget admin:pass@www.mywebsite/test.php但具有类似的错误。我如何解决?先谢谢您的帮助。
but with similar errors. How can I solve? Thank you in advance for your help.
推荐答案您犯了一个小错误。
在网址前保留 http:// 。
您有
管理员:pass @ www.mywebsite/test.php
更改为
http:// admin:pass@www.mywebsite/test.php
希望有效。
更多推荐
Cronjob与密码保护网站(.htaccess)
发布评论