0

I have small query today I happen to see when I typed a website "http://www.websitename.net"

it automatically got converted to "http://www.websitename.com" i.e., .net to .com and then the page as loaded.

I am eager to know how it has been done.

3
  • 1
    It's just a redirect, they own both domains. Commented Jun 13, 2012 at 15:49
  • 1
    It was probably not done using JavaScript, but a server-side redirect Commented Jun 13, 2012 at 15:49
  • ok i was thinking there was a way using javascript.... i think Ryan was correct Commented Jun 13, 2012 at 15:51

2 Answers 2

1

This is generally done as a server-side redirect.

You can watch the network traffic and see for yourself what happens. For example in IE9, use the Developer Tools (F12), click the Network tab, and click the "Start capture" button to start monitoring. Other browsers have similar features.

In the Response headers you'll see something like

Key         Value
Response    HTTP/1.1 301 Moved Permanently
Location    http://mywebsitename.net
Sign up to request clarification or add additional context in comments.

Comments

0

Your browser assumes you might have made a mistake (when the host is not found) and will try alternate (common) domains. This is assuming that the site does not exist.

If this is happening on a site that DOES exist (such as when you go to wikipedia.com), a redirect (HTTP 302 - Moved Temporarily) will be returned.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.