I ran into a website today that had two URLs and I'm completely stunned. The website, not to be specific, has a full address of http://example/cat/http://example/dog. I will say that the first part is a randomly generated ad that pops up, but regardless isn't going to two addresses the equivalent of being at two different houses at the same time i.e. impossible? Anyhow, I just wanted some clarification on how it works.

And before you ask, the site is not exactly something that I would paste on an affluent forum thus the reason I have left it out.

  • 1
    http is the URL scheme/protocol. It's not a header. – Lèse majesté Jan 18 '12 at 7:16
  • What @Lèsemajesté said. Also the example couldn't possibly work as a valid URL; you might want to correct that. And what does the "first part" refer to? (example? cat? The http?) The "randomly generated ad" bit is also unclear. – Su' Jan 18 '12 at 10:22
  • I edited the title, view history to make sense of @Lèsemajesté's comment. – paulmorriss Jan 18 '12 at 11:45

Your example URL, http://example/cat/http://example/dog, points to a page accessed with the http protocol, on the host example, with the path cat/http://example/dog. It's perfectly valid for the path part of a URL to contain elements that look like the protocol and hostname parts of another URL.

One relatively prominent example of a legit site using such URLs is archive.org's Wayback Machine. For example, to see what https://webmasters.stackexchange.com/ looked like in late 2010, you can go to http://web.archive.org/web/2010/https://webmasters.stackexchange.com/.

|improve this answer|||||

The second one can simply be a parameter in the URL.

|improve this answer|||||

People also often see "http" in their access logs when the forget the colon in a link to an external site. For example on the page http://example.com/finder/findstuff is the following HTML:

<a href="http//www.google.com/">Search Google</a>

Due to the missing colon, this will result in the visitor being sent to http://example.com/finder/http//www.google.com/ when clicking on the link.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.