by ClaDax
7 replies
  • WEB DESIGN
  • |
Hi there,

I purchased a Html template and i'm finally done. I uploaded it as index.html and when I type in the website address the website shows up properly. I now searched the website for my problem but maybe it is that easy to solve that nobody opened a thread before

How do I add the prefix "www" to my domain name? I am used to WordPress and there I could go the the settings and fix it (or better: add it).

But I never did something similar with a Html file. I assume that I need to go to my host server Hostgater?

Thank you!
#adding #prefix #www
  • Profile picture of the author mgreener
    Hi,

    This is a hosting/domain issue. Most hosts will automatically setup the domain.com and www.domain.com for you, but if for some reason it's not working, then just talk to your host about it and it's an easy fix.

    Once that is worked out, then you should fix canonical issues by putting determining if you want the domain to show with or without the www. in front (visitors can type it in either way and it will work, but everything will be directed to one version, thus establishing a canonical URL and reducing the possibility of duplicate content).

    I believe that there are some Wordpress plugins that can do this too.
    {{ DiscussionBoard.errors[5888115].message }}
  • Profile picture of the author msu
    If your host won't help you can also do it with a redirect in an .htaccess file.
    Signature
    New to WordPress? Save time with my beginner's guide:
    WordPress Step-by-Step
    (for Kindle & Kindle Apps)

    I'm a top-notch WordPress developer: hire me
    {{ DiscussionBoard.errors[5888752].message }}
    • Profile picture of the author Eric Seiler
      I agree with mrgreener. Typically, the host sets that up automatically.

      Also, it is a best practice just to use one or the other for backlinking purposes as it is easier to track in various tools and can impact your SERP ranking.

      A few years back I went through a small link building campaign and accidentally used "www" instead of what I normally do, which is to remove it. Long story short, it took me awhile to figure out why I wasn't seeing any results for my efforts. Well, that is because google saw them as two different pages.

      Newbie mistake, but I was a real newbie then. Now I'm just a veteran newbie
      {{ DiscussionBoard.errors[5888827].message }}
  • Profile picture of the author itsohsoeazy
    just open up notepad and name it .htaccess.
    paste this code in it change your_url to your url.

    //Rewrite to www
    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^your_url.com[nc]
    RewriteRule ^(.*)$ http://www.your_url.com/$1 [r=301,nc]

    Then place it in your root folder.
    {{ DiscussionBoard.errors[5890160].message }}
    • Profile picture of the author Andrew H
      I do this all the time, I saw the thread and thought I could help!

      But it seems itsohsoeazy beat me too it.

      If you are unfamiliar with your htaccess file it will be in your websites root directory. If you are running something like Joomla/Wordpress it will most likely already have a htaccess, so just download it and add the code to it.
      Signature
      "You shouldn't come here and set yourself up as the resident wizard of oz."
      {{ DiscussionBoard.errors[5890647].message }}
  • Profile picture of the author ClaDax
    Okay thanks everyone.

    I wrote this in my notepad:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^http://mydemo.co.uk[nc]
    RewriteRule ^(.*)$ http://www.mydemo.co.uk/$1 [r=301,nc]

    And saved it as a .htaccess file and uploaded it to the root. (Replaced it with the other one).

    When I refresh the site, nothing happens...
    {{ DiscussionBoard.errors[5891590].message }}
    • Profile picture of the author itsohsoeazy
      Originally Posted by ClaDax View Post

      Okay thanks everyone.

      I wrote this in my notepad:

      Options +FollowSymLinks
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^http://mydemo.co.uk[nc]
      RewriteRule ^(.*)$ http://www.mydemo.co.uk/$1 [r=301,nc]

      And saved it as a .htaccess file and uploaded it to the root. (Replaced it with the other one).

      When I refresh the site, nothing happens...
      you forgot

      //Rewrite to www

      thats the start of it. then the only change you should see is the "www." appear when you refresh your page.
      pm me if you need more help. i had forgotten to check back.
      {{ DiscussionBoard.errors[5969892].message }}

Trending Topics