Cronjob与密码保护网站(.htaccess) [英] Cronjob with password protected site (.htaccess)

查看:249
本文介绍了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' http://www.mywebsite.com/test.php

但是cron给我以下错误:

But cron gives me the following error:

--2012-05-02 10:14:01--  http://www.mywebsite.com/test.php
Resolving www.mywebsite.com... IP
Connecting to www.mywebsite.com|IP|:80... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Reusing existing connection to www.mywebsite.com:80.
HTTP request sent, awaiting response... 403 Forbidden
2012-05-02 10:14:01 ERROR 403: Forbidden.

我也尝试了:

wget admin:pass@http://www.mywebsite.com/test.php

但具有类似的错误。我如何解决?先谢谢您的帮助。

but with similar errors. How can I solve? Thank you in advance for your help.

推荐答案

您犯了一个小错误。

在网址前保留 http://

您有


管理员:pass @ http://www.mywebsite.com/test.php

更改为


http:// admin:pass@www.mywebsite.com/test.php

希望有效。

这篇关于Cronjob与密码保护网站(.htaccess)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆