Cronjob与密码保护网站(.htaccess)

编程入门 行业动态 更新时间:2024-10-09 22:20:49
本文介绍了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)

本文发布于:2023-11-01 01:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547814.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密码保护   网站   Cronjob   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!