![]() |
#1 | ||
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2007
Location: Hlavni Mesto Praha, Czech Republic
Posts: 21
|
![]() hi folks,
I've just typed "abandonia.com" in my browser as every day and it redirects me to completely another page (www.student.se). www.abandonia.com works fine... how's that possible? |
||
![]() ![]() |
|
![]() |
#2 | ||
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
|
![]() I'm guessing something with DNS. Student.se is another site of the company holding ownership of Abandonia.
I'll get in touch with them to resolve it. |
||
![]() ![]() |
|
![]() |
#3 | ||
|
![]() Both hostnames resolve to same IP, so DNS should not be an issue.
More often than not, this behavior is a result of virtual host definition of the webserver. In Apache webserver which seems to be serving abandonia content, it would be relevant to ServerName and ServerAlias directives within virtual host definition. There's almost infinite number of other possibilities (why, you could even have a script on abandonia page to achieve this |
||
|
|
![]() |
#4 | ||
![]() ![]() ![]() Join Date: Apr 2009
Location: Highgate, England
Posts: 1,459
|
![]() Do you want to explain how it works, or shall I..?
|
||
![]() ![]() |
|
![]() |
#5 | ||
|
![]() Ok let me try. Please fill in the gaps...
When you want to view a webpage in the browser, typically you type some URL in the address bar, like "www.abandonia.com/en/forum". Nowadays our browsers are smart, so since you have not specified any protocol to use, it will default to HTTP, and prepend this, so the actual URL will become "http://www.abandonia.com/en/forum" - that's what you will see in the address bar when page gets loaded. Based on this information, it can now create a HTTP request, which consists of many fields (you can think about it as a form to fill in), two of which are relevant to our problem - Host field and URI field. Host field will be domain address part of URL, ie. "www.abandonia.com". URI field will be the document we want to access from the website, ie. everything after "http://www.abandonia.com" - in our example it is "/en/forum" document. With HTTP request prepared, browser asks operating system to send this request towards the webserver. Normally the webserver address provided by browser to OS is the same as Host filed in the HTTP request (ie. "www.abandonia.com"). Computers like to crunch numbers, so they know each other's addresses in IP numbers, like "94.247.169.19". They don't like the domain names like we do, so there is DNS, a service which provides "translation" from our domain names to IP addresses. Since we put into the browser the URL in human readable form, OS has to perform the translation of the name browser provided, to find out which computer IP address to speak to. So it asks DNS server what is the IP address of "www.abandonia.com", and in our example, recieves an answer, that "www.abandonia.com" has an IP "94.247.169.19". At this moment OS can wrap our HTTP request from the browser into packet and send it towards IP address "94.247.169.19". When packet arrives to its destination computer "94.247.169.19", it will take the packet and hand it over to webserver software (Apache in our case), which will unwrap the HTTP request from it (You can think about it as when you order a book - it comes wrapped in paper with your address, and you have to unwrap it to get to the contents of the package). In the request it looks into Host field to see which website this request is destined for, and into URI field to see which document from that website to provide from that website. Nowadays a typical webserver handles more than one website, and some handle even 100,000s and more. This is called virtual hosting, since lots of websites are running without a real machine assigned solely for them - they are virtual in this sense). The Host field from the HTTP request serves as an information for the webserver to decide which of these virtual websites to use for the requested document. In Apache, every virtual host is defined in it's own configuration section, and has two important directives - ServerName and ServerAlias. When Apache receives a HTTP request and looks up the Host field, it compares the literal string with all virtual host definitions, to see if some ServerName or ServerAlias matches. If it does, it knows which website the request is destined for, and serves the document from that website. However if it does not find the match, it has a fallback mechanism, to use very first definition in the configuration (aka default virtual host). To apply all this to our problem: If you try ask DNS for IP address of both www.abandonia.com and abandonia.com, it returns the same IP - hence the same computer is contacted in both cases. Most probably Apache webserver has a virtual host definition for abandonia, which has www.abandonia.com defined in one of ServerName or ServerAlias directives, however abandonia.com is not there. Therefore when you send a request for www.abandonia.com, that will be present in the Host field of HTTP request, and Apache will find the exact match in virtual host definition and serve abandonia content as you expect. However if you use abandonia.com only, Apache will look into Host field and won't be able to find that match in virtual host definition. Therefore it triggers the fallback mechanism, and servers the first definition configured, which happens to be www.student.se website, and serves it to you (this is a matter of choice - is it better to serve an error or a (hopefully relevant) page? Server is run by Student.se company, so the relevance is kind of there...) A fix for this would be to put abandonia.com into one of these directives in Apache, so it can match it against the HTTP Host parameter in the request. Hopefully it makes all some sense - keep in mind that I have tried to simplify things a lot, and since the whole topic is huge (only RFCs would take a pretty long bookshelf), I don't even know it all to detail (and I never ever would), so some incorrectness/omission is definitely present, however the core logic of it should be pretty accurate. |
||
|
|
![]() |
#6 | ||
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
|
![]() Far as I've been told, Abandonia is hosted on a physically separate server, but using the same connection (in fact the move to that separate server caused a load of problems with the site on the beginning of last December).
|
||
![]() ![]() |
|
![]() |
#7 | ||
|
![]() Quote:
wget -v 94.247.169.19 --16:30:16-- http://94.247.169.19/ => `index.html' Connecting to 94.247.169.19:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://www.student.se/ [following] --16:30:16-- http://www.student.se/ => `index.html' Resolving www.student.se... 94.247.168.134 Connecting to www.student.se|94.247.168.134|:80... connected. HTTP request sent, awaiting response... 200 OK we can see that default host on abandonia IP contains redirect to a different server www.student.se, 94.247.168.134. Should have checked this before to make analysis more complete. However from my point of view it does not change situation much - still there seems to be virtual hosting used (if setudent.se is big enough, they probably have some config templates and do not optimize for stand-alone webserver - after all, it's much easier to expand it later. Until the ServerName/Alias is ruled out, I would go for it first place. |
||
|
|
![]() |
#8 | ||
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Valleyfield, Canada
Posts: 4,892
|
![]() You are welcome to register to the site anytime you wish, knowledgeable guest. (Assuming you are not already registered or a banner user, of course. |
||
![]() ![]() |
|
![]() |
#9 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: May 2005
Location: Nitra, Slovakia
Posts: 6,533
|
![]() what the fuuuuuuuuuuuuuuuu? i was about to make the same topic
this is not fair at all, studentis need to be notified ASAP. they better didn't do this on purpose.. like 3/4 of the people access websites by the short terms. abandonia.com, not www.abandonia.com. google.com, not www.google.com. who the hell is supposed to write that? seriously, they need to fix this soon otherwise we are losing a LOT of vists
__________________
![]() |
||
![]() ![]() |
|
![]() |
#10 | ||
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
|
![]() Andreas' response is that he'll get his employees to fix this ASAP.
|
||
![]() ![]() |
|