.htaccess site redirect http:// to www not working

Standard

I was having some trouble with the URL for the jessINK website.

The website was loading when I typed, “www.jessink.com”

But not when I typed, “jessink.com” or “http://jessink.com” (without the “www”)

I typed this into my .htaccess file (code from Media Temple website):

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.jessink\.com$ [NC]
RewriteRule ^(.*)$ http://www.jessink.com/$1 [L,R=301]

And my website still wasn’t loading without the “www”.

Contacted webhosting provider. They were helpful and checked the website — they said that the .htaccess file was being read, and kept asking me to check things on my side again (because the website was loading fine on their end, with or without “www”).

After MUCH pondering and poking around, I opened up the DNS section for one of my other websites (dragonsinn.net, which has always loaded properly, as “http://dragonsinn.net” or “http://www.dragonsinn.net“).

Since the websites are hosted on the same server, I checked everything line by line.

I noticed the following in the DNS Management section for dragonsinn.net:

dragonsinn_DNS

So I went into the DNS Management section for jessink.com:

jessINK_DNS

The highlighted portion shows the (updated) nameservers as:

dns1.precisioneffect.com
dns2.precisioneffect.com

Originally, the nameservers were listed as:

ns1.precisioneffect.com
ns2.precisioneffect.com

I changed the nameservers to “dns1″ and “dns2″ because that’s what my welcome email stated (when I first purchased the hosting for jessink.com). “dns1″ and “dns2″ were also the nameservers I had input into the URL domain side (which is separate from my hosting account).

My website is now working fine as:

http://jessink.com and http://www.jessink.com

In my case, it was one.damn.letter.that.made.the.difference. I really wish I’d figured it out sooner because it would have saved me several hours of my life.

So I just thought I’d post this in case it’s of help to anyone else out there, struggling with the http:// redirect thingie (since in my case, it wasn’t the .htaccess file that was the problem, but the NAMESERVERS).

=====

P.S. I’ve since used Google Webmaster to point the http:// version of the website to http://www (for indexing purposes; I’m not using any .htaccess file at the moment).

P.P.S. Why don’t all websites automatically load with or without the “www” prefix? Some things, I guess I’ll never know…

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s