简体   繁体   English

通过GET提交“ http:// www。”时出现403错误。 即使已预先编码。 这有解决方案吗?

[英]I get a 403 error when submitting “http://www.” via GET. Even if it's encoded beforehand. Is there a solution for this?

It seems like my shared host provider is detecting the presence of "http://www" or "http%3A%2F%2Fwww" in any get request and serving up a 403 page. 似乎我的共享主机提供商正在检测任何获取请求中是否存在“ http:// www”或“ http%3A%2F%2Fwww”并提供403页。

I also get an 'in addition' error... 我还会收到“其他”错误...

"Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request." “此外,尝试使用ErrorDocument来处理请求时遇到了404 Not Found错误。”

This only happens with this string. 仅此字符串会发生这种情况。 If I change it to something else the get is successfully submitted and the target page successfully returned. 如果我将其更改为其他内容,则会成功提交get并成功返回目标页面。

If it helps I'm writing a QR code getter, so the ability to submit urls is quite important. 如果可以帮助我编写QR码获取程序,那么提交URL的功能就非常重要。

Also, strangely I can submit a url as long as it doesn't have 'www' in it. 另外,奇怪的是,我可以提交一个URL,只要其中没有'www'。 I can also submit 'www' as long as it isn't preceded by 'http://' (or the encoded version) 我也可以提交“ www”,只要它前面没有“ http://”(或编码版本)

edit: Just to confirm this wasn't a specific problem with the page I was writing, I went to another page on my website that uses get request and manually inserted the string. 编辑:只是为了确认这不是我正在编写的页面的特定问题,我转到了网站上使用get请求并手动插入字符串的另一个页面。 This also generates the 403 error. 这也会生成403错误。

Yes -- there are two solutions: 是的-有两种解决方案:

  1. Request to remove this strange security feature for your account from your provider. 请求从提供商处为您的帐户删除此奇怪的安全功能。
  2. Don't send urls with http://www in them. 不要发送包含http:// www的网址。 For example replace this scting in javascript before sending data to some "%htpwwwashere:(%", that will be replaced by you back in PHP. 例如,在将数据发送到某些“%htpwwwashere:(%”)之前,请用javascript替换此scting,然后将其替换为PHP。

Replace any instances of http://www. 替换http://www.所有实例http://www. with StackOverflowRulez and in your PHP have it replace the $_GET StackOverflowRulez with http://www. 使用StackOverflowRulez并在您的PHP中将$_GET StackOverflowRulez替换为http://www. .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM