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

www.yourdomain.com vs. yourdomain.com


© May 2019 Anthony 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:

 <VirtualHost 99.99.99.99:80>
         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 Parallels Desktop 12

Take Control of OS X Server

Sierra: A Take Control Crash Course

Take Control of iCloud

Take Control of Apple Mail, Third 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





There are two ways to write error-free programs; only the third one works. (Alan Perlis)




Linux posts

Troubleshooting posts


This post tagged:

Blogging

Web/HTML



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode





SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)
www.SCOsales.com