APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

www.yourdomain.com vs. yourdomain.com

© December 2005 Tony Lawrence

Most likely "www.yourdomain.com" and "yourdomain.com" take you to exactly the same place. That's because (again, most likely) your Apache or IIS configuration is set to do just that. In Apache, it might look something like this:

         ServerName   yourdomain.com:80
         ServerAlias  www.yourdomain.com

Unfortunately, that can cause unexpected problems for you from search engines and ranking sites that are too lazy to notice that these really are the same site.

For example, Netcraft has a nice little anti-phishing toolbar that also happens to show relative site popularity. I'd been running that toolbar for about a month when I noticed something I thought was odd: the Netcraft ranking for my main site had suddenly dropped by 33%. How could that be? A minute ago I was in the 16,000 neighborhood and suddenly I was near 20,000 instead.

The answer was simple: I had gone to "www.aplawrence.com" rather than my usual lazy "aplawrence.com". Netcraft saw those as different sites, and ranked them differently.

Solving that was easy enough: I moved the "ServerAlias www.aplawrence.com" to the pcunix.com website, which does a 301 Redirect to aplawrence.com. Restarting Apache now redirects any "www" access to the unadorned site. Netcraft may still have statistics on the "www" site, but those will fade away over time and all access will be properly credited to one site.

See also 301 Redirects And Domains With And Without WWW

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> www.yourdomain.com vs. yourdomain.com

Inexpensive and informative Apple related e-books:

Take Control of Pages

Take Control of High Sierra

Are Your Bits Flipped?

Photos for Mac: A Take Control Crash Course

Take Control of the Mac Command Line with Terminal, Second Edition

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

One in a million is next Tuesday. (Gordon Letwin)

Linux posts

Troubleshooting posts

This post tagged:



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode