Does it matter if the same website can be access with www. and without?

Generally if a website can be reached by both www. or without in the domain name, it really doesn't matter much as this article will tell you. However, some SEO guru will argue that search engine will treat this as two separate pages, therefore can cause duplicate contents which isn't good. I'm still not 100% sure about this but to be safe it should be done anyway.

Luckily, Drupal is aware of this and have given us a choice if we want to redirect to either www. or without using .htaccess files. Below is an example, there is a section in your .htaccess file:

 # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

To make it redirect to your site without the www. then just uncomment the couple of lines as shown below (remember to replace the domain name (example.com) with your own), so it looks like this:

 # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # adapt and uncomment the following:
   RewriteCond %{HTTP_HOST} ^www\.duvien\.com$ [NC]
   RewriteRule ^(.*)$ http://duvien.com/$1 [L,R=301]

If you want the www. then only uncomment the other two lines above, so it should look like this:

 # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
   RewriteCond %{HTTP_HOST} ^duvien\.com$ [NC]
   RewriteRule ^(.*)$ http://www.duvien.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.exmaple\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

 

The content of this field is kept private and will not be shown publicly.
Your email address will be kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.