6

I've recently stumbled upon a website called Overlay101 which allows you to create tours for other websites.

I was very interested to see the technique they use to load the third party websites for editing.

When you type the address of the website, it is loaded as a sub domain of the overlay101.com website.

For example, if I type https://stackoverflow.com/questions/111102/how-do-javascript-closures-work - it is loaded as http://stackoverflow.com.www.overlay101.com/questions/111102/how-do-javascript-closures-work

I was wondering how is that subdomain creation achieved and I saw in the source code of the page that JavaScript in injected. I was wondering how was that possible too.

What intrigued me most is that Stackoverflow.com does not allow pages to be loaded within frames - I was wondering how they managed to load up the page so that tour popups could be added.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Hirvesh
  • 7,636
  • 15
  • 59
  • 72
  • I know this is not strictly a programming question - but I've looked everywhere and Stackoverflow is my last place to find answers! – Hirvesh Jan 18 '13 at 12:22
  • 1
    Notice that you're not logged in on the resulting page, so it's not a frame. I'd guess that it's grabbing and pasting HTML. Also, the subdomain creation is URL-rewriting magic; see Apache's [mod_rewrite](http://httpd.apache.org/docs/current/mod/mod_rewrite.html). (Not present on that page is how to rewrite subdomains but I know one can do it.) – Waleed Khan Jan 18 '13 at 12:25

1 Answers1

1

They simply use wildcard DNS entries to make all subdomains work. They then use the Host header to get the original domain name and download the HTML code of the site. Since they do this on the server side they do not need any frames etc.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636