Search Engine Watch
SEO News

 

  #1  
Old 01-23-2008
texken texken is offline
Member
 
Join Date: Feb 2006
Posts: 30
texken is on a distinguished road
Redirects, DNS and WWW Oh My!

I'm looking for the right, best, correct way to setup DNS for today's websites - specifically the right way to handle www.domain.com versus domain.com.

I'll first start by saying I'm not technical or a server admin my trade, but I know enough to be dangerous. I know redirects should be a 301 permanent redirects in most cases.

Recently I've noticed that many websites seem to be redirecting from their domain.com to their www.domain.com (example: target.com). The way we have historically done our DNS is to set up an A record for domain.com set to the appropriate IP address and then www.domain.com with a CNAME record pointed to domain.com. This way either one works.

Feedback?
Reply With Quote
  #2  
Old 01-23-2008
AussieWebmaster's Avatar
AussieWebmaster AussieWebmaster is offline
Forums Editor, SearchEngineWatch
 
Join Date: Jun 2004
Location: NYC
Posts: 8,197
AussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant futureAussieWebmaster has a brilliant future
Re: Redirects, DNS and WWW Oh My!

I usually point every thing to www.domain.com and then redirect all other stuff to it - like domain.com, domain.com/index.extensions (htm, html, etc)
Reply With Quote
  #3  
Old 01-23-2008
texken texken is offline
Member
 
Join Date: Feb 2006
Posts: 30
texken is on a distinguished road
Re: Redirects, DNS and WWW Oh My!

Quote:
Originally Posted by AussieWebmaster View Post
I usually point every thing to www.domain.com and then redirect all other stuff to it - like domain.com, domain.com/index.extensions (htm, html, etc)
Thanks for the quick response. Point everything how exactly? I'm trying to figure out the best way to set up my DNS records.
Reply With Quote
  #4  
Old 01-25-2008
Jazajay's Avatar
Jazajay Jazajay is offline
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 705
Jazajay has disabled reputation
Re: Redirects, DNS and WWW Oh My!

Ok change the variables but place this in your .htaccess file
Quote:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yoursite\.co.uk
RewriteRule ^(.*)$ http://www.yoursite.co.uk/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.php
RewriteRule ^(.*)index\.php$ / [R=301,L]
Ok what this says.
If your server is capable of rewriting urls via mod_rewrite
this turns the module on
Quote:
RewriteEngine On
Ok you need to sort out any cronicalization issues this will redirect any url that is not .co.uk to .co.uk.
Quote:
RewriteCond %{HTTP_HOST} !^www\.yoursite\.co.uk
RewriteRule ^(.*)$ http://www.yoursite.co.uk/$1 [R=301,L]
this will rewrite any url to your .co.uk version.
that includes
yousite.com
yoursite.com/page/page/page/product.php

Ok next you need to redirect all urls that are yoursite.co.uk/index.php
to yousite.co.uk
this does that for you
Quote:
RewriteCond %{THE_REQUEST} ^GET\ .*/index\.php
RewriteRule ^(.*)index\.php$ / [R=301,L]
you don't need to but it looks nicer IMO.

That should do you for starters

Jaza
Reply With Quote
  #5  
Old 01-25-2008
Jazajay's Avatar
Jazajay Jazajay is offline
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 705
Jazajay has disabled reputation
Re: Redirects, DNS and WWW Oh My!

Are your DNS('s) set up properly?
Can you access your domain if you type it in the addres bar? Even if it is a blank page?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 06:02 AM.