Here is an example.

I configured images urls with : //cdn3.example.com
My site domain is : http://www.example.com

In HTML code images are replaced like this :
/sites/default/files/imagecache/teaser/field_picture/0374.jpg
==> http://www.example.com/sites/default/files/imagecache/teaser/field_pictu...
becomes
//cdn3.example.com/sites/default/files/imagecache/teaser/field_picture/0374.jpg

Browsers understand this URL as :
http://cdn3.example.com/sites/default/files/imagecache/teaser/field_pict...
great!!

But some URL checker bots understand this URL as :
http://www.example.com//cdn3.example.com/sites/default/files/imagecache/...

Is it possible to configure URL with http://cdn3.example.com
and not //cdn3.example.com
So that there will be no more confusion.

Comments

srobert72’s picture

It seems to work if I I configure images urls with : http://cdn3.example.com

But why did you recommend and give examples with just //cdn3.example.com in documentation ?
It could be confusing and bugged isn't it ?

dman’s picture

indeed. Any configuration that produces URLs like // is incorrect and open to misinterpretation. Should not happen.

mikeytown2’s picture

srobert72’s picture

Component: Code » Documentation
Category: bug » task

Sorry for duplicate issue. I searched before submitting but didn't find this one.
Thank you for information.

So this problem could be only with bots that don't respect standards ?
I can't give you complete list but I met problem with many bots, and not only unknown ones !!

So there is really a risk to write URL starting with "//".
And it's only to preserve HTTPS sites that are less frequent.

I think it could be good to precise in documentation this risk and its workaround.
And it could be explained that for only HTTP sites there is no need to write "//" and so less risk to write "http://" URLs.

dman’s picture

@mikeytown2 Damn, haven't seen anything that used that syntax for years. Like actual decades. I was playing with freaking ARCHIE and Gopher when I last had cause to wonder "Why double slashes in an URL? What if not?".

I gotta say that every other time since, seeing odd // in HTML has been the result of an error somewhere. :-B
Thanks for the enlightenment. It does sound like a bad 'bot then.

wim leers’s picture

Status: Active » Closed (fixed)