# How do I get my domain name to come up without the www?

**URL:** https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563
**Category:** Factual Questions
**Created:** [January 11, 2006, 9:48pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563 "2006-01-11T21:48:18Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Interrobang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/interrobang/32/17463_2.png) [@Interrobang](https://boards.straightdope.com/u/Interrobang)
#### Post date: [January 11, 2006, 9:48pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/1 "2006-01-11T21:48:18Z")

</div>

I’ve got a couple of websites – blogs, actually. And I’ve registered a couple of domain names that point to those websites.

And they work – if you enter [www.hypotheticalsitename.com](http://www.hypotheticalsitename.com) into your search engine of choice, the appropriate site will pop up.

However, if you type just [hypotheticalsitename.com](http://hypotheticalsitename.com), sans www, into your search engine, a white page comes up.

This is true for both domain names. They are registered with different registrars, so it’s not just a problem with one service.

Obviously, something in the configuration isn’t quite set up correctly.

What do I, a reasonably smart but not web-tech-savvy person, need to do to get these sites to come up if the name is entered without the www?

---

<div class="post-metadata">

### Author: ![iamthewalrus\_3](https://avatars.discourse-cdn.com/v4/letter/i/258eb7/32.png) [@iamthewalrus\_3](https://boards.straightdope.com/u/iamthewalrus_3)
#### Post date: [January 11, 2006, 10:00pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/2 "2006-01-11T22:00:06Z")

</div>

When you are saying “search engine”, are you sure you don’t actually mean “browser address bar”?

Basically, you need to change the DNS entry for your domain name. Whoever is running your nameservers (could be your registrar, could be your host, could be a third party) has a list of which names go to which ip addresses, and right now, the only one that is set up is the “www” prefix. You could add the “no prefix option” to route to your webpage, or, if the webpage is all you need to do with the domain name, you can probably tell the nameserver to route all prefixes to that computer. In this way, [whateveryoutype.hypotheticalsitename.com](http://whateveryoutype.hypotheticalsitename.com) would get routed as well.

---

<div class="post-metadata">

### Author: ![Interrobang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/interrobang/32/17463_2.png) [@Interrobang](https://boards.straightdope.com/u/Interrobang)
#### Post date: [January 11, 2006, 10:02pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/3 "2006-01-11T22:02:47Z")

</div>

> [@iamthewalrus(:3=](#):
>
> When you are saying “search engine”, are you sure you don’t actually mean “browser address bar”?

I am a moron.

Yes, I mean “browser address bar.” I have no idea why I typed “search engine.” Twice. And didn’t catch it when I previewed.

Thanks for deciphering me anyway.

---

<div class="post-metadata">

### Author: ![ed](https://avatars.discourse-cdn.com/v4/letter/e/c77e96/32.png) [@ed](https://boards.straightdope.com/u/ed)
#### Post date: [January 11, 2006, 10:53pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/4 "2006-01-11T22:53:14Z")

</div>

This could be any number of things, but one way to find out is to do an nslookup (or just ping) both the root address (without the www) and the subdomain (with the www). If they both resolve to the same IP, then the problem is with the webserver, which is serving files from different locations based on the domain name specified in the browser request. This is pretty common, webhosts will often use one webserver with a single IP and keep accounts seperate based on the incoming domain name. If this is the case they simply need to add your root domain to this list, or alter it if it exists to be consistent with the www subdomain.

If the IP’s resolve differently, then you somehow ended up with dns entries for your root domain and subdomain that resolve to different addresses and whoever maintains your nameserver should be able to clear that up.

In either case, it’s probably something your host can fix for you, or if you manage your own webserver you’ll have to consult the documentation a bit. In IIS they’re called “host headers” and you can add them per virtual server, for apache it will be a directive in your httpd.conf depending on the version.

---

<div class="post-metadata">

### Author: ![alterego](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alterego](https://boards.straightdope.com/u/alterego)
#### Post date: [January 11, 2006, 11:04pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/5 "2006-01-11T23:04:22Z")

</div>

2-3 lines in your sites .htaccess will suffice.

See the section on “Canonical Hostnames” in Apache’s [URL Rewriting Guide](http://httpd.apache.org/docs/2.0/misc/rewriteguide.html)

---

<div class="post-metadata">

### Author: ![alterego](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alterego](https://boards.straightdope.com/u/alterego)
#### Post date: [January 11, 2006, 11:05pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/6 "2006-01-11T23:05:35Z")

</div>

You may also find [this entry](http://www.mattcutts.com/blog/seo-advice-url-canonicalization/) by googler Matt Cutts interesting.

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [January 11, 2006, 11:45pm UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/7 "2006-01-11T23:45:26Z")

</div>

> [@alterego](#):
>
> 2-3 lines in your sites .htaccess will suffice.
> 
> See the section on “Canonical Hostnames” in Apache’s [URL Rewriting Guide](http://httpd.apache.org/docs/2.0/misc/rewriteguide.html)

This only applies if the domain in question already points to the same IP, and if that machine is running Apache, and if the OP has any capability to alter the Apache config.

---

<div class="post-metadata">

### Author: ![alterego](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alterego](https://boards.straightdope.com/u/alterego)
#### Post date: [January 12, 2006, 12:01am UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/8 "2006-01-12T00:01:46Z")

</div>

> [@friedo](#):
>
> This only applies if the domain in question already points to the same IP, and if that machine is running Apache, and if the OP has any capability to alter the Apache config.

The entire situation can be solved in a few lines of the given .htaccess of the root world-readable folder, bit it public\_html, www or what have you. Apache runs on most of the web servers in the world - you usually pay a premium for a windows server, in fact, so I feel it was a reasonable assumption.

And just to make it clear - it is not necessary to make any alteration to the apache config file. It can be done in .htaccess.

---

<div class="post-metadata">

### Author: ![Interrobang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/interrobang/32/17463_2.png) [@Interrobang](https://boards.straightdope.com/u/Interrobang)
#### Post date: [January 12, 2006, 12:12am UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/9 "2006-01-12T00:12:25Z")

</div>

> [@alterego](#):
>
> The entire situation can be solved in a few lines of the given .htaccess of the root world-readable folder, bit it public\_html, www or what have you.

I should be more clear. My ability to make changes is limited (so far as I know) to logging on [godaddy.com](http://godaddy.com) or [buydomains.com](http://buydomains.com) and twiddling my DNS settings. I’m not hosting my own sites at all – the blogs are both on Typepad.

And I have no idea what a .htaccess is, but that’s my own damn-fool ignorance.

---

<div class="post-metadata">

### Author: ![alterego](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alterego](https://boards.straightdope.com/u/alterego)
#### Post date: [January 12, 2006, 12:20am UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/10 "2006-01-12T00:20:28Z")

</div>

I see. .htaccess iss just a per-directory configuration file you can have on your server. For most situations, as long as you have permission to write in that directory, you have a lot of leeway in what you can do. But given this, I have to revert to the walrus.

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [January 12, 2006, 12:30am UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/11 "2006-01-12T00:30:19Z")

</div>

> [@alterego](#):
>
> The entire situation can be solved in a few lines of the given .htaccess of the root world-readable folder, bit it public\_html, www or what have you. Apache runs on most of the web servers in the world - you usually pay a premium for a windows server, in fact, so I feel it was a reasonable assumption.

You are assuming an awful lot. We don’t yet even know if the OP’s two domains are pointing to the same place. And even if he’s running Apache, we don’t know if .htaccess is enabled or if he can change it.

---

<div class="post-metadata">

### Author: ![Interrobang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/interrobang/32/17463_2.png) [@Interrobang](https://boards.straightdope.com/u/Interrobang)
#### Post date: [January 12, 2006, 3:01am UTC](https://boards.straightdope.com/t/how-do-i-get-my-domain-name-to-come-up-without-the-www/339563/12 "2006-01-12T03:01:08Z")

</div>

> [@friedo](#):
>
> We don’t yet even know if the OP’s two domains are pointing to the same place.

Two separate domains, two separate places, the same problem from two separate registry companies. For whatever reason.

Thanks for the tips, everyone.
