www.webdeveloper.com
Results 1 to 5 of 5

Thread: recommended way to change domain names

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    22

    recommended way to change domain names

    I am currently hosting my website at home using xampp and a DynDNS account. everything is working great and I have worked hard to get good Google results. Unfortunately, I need to change my domain name of my site. I have read several articles and know there are several ways of doing this, but I am just wondering which one is the recommended way of doing so? One way I figured I can do this is to just point my old and new domain name to the same ip address of my computer I am hosting from (i believe my DynDNS account lets me do so). The other way, which appears to be the better way but not sure, is to use a 301 redirect. If I were to go this route, how exactly do i set it up? I understand that it is basically just putting a line of code in the header of the old site which directs it to the new one. This is fine and all, but brings on the question of, am I technically hosting 2 sites on my computer now?

    I would have www.olddomain.com pointing to my ip of my computer with basically a blank index.html with the redirect header redirecting it to www.newdomain.com which would also point to the same ip of my computer. If this is the case, how would I, technically speaking, host those 2 sites from one computer? An additional question is do I just place the redirect code in the index.html or do I place it in every page of the site and redirect it to the same page on the new domain? If the process of using 301 redirect is different from what I am assuming then can someone please elaborate on exactly how to use it in my situation?

    Thank you for any help

  2. #2
    Join Date
    Mar 2011
    Posts
    1,139
    You should use a 301 redirect. This will not only accommodate users who have bookmarked your site with your original domain name or who click on links to your original domain name, it will also tell the search engines that your site has moved and they will transfer most of the value of the links that point to your original domain name to the new one. It may take a few weeks for the search engines to absorb all of the changes, so you'll probably see a dip in your rankings and traffic for a while after you do this.

    You don't need to bother with your settings in DynaDNS. Just use an .htaccess file on your home server. A search on "htaccess change domain name" should give you the specific .htaccess code required. And once you set up the 301 redirect, use an online server response checker to make sure that your original domain name responds with the correct 301 redirect code and the correct URL for your new domain name.
    Last edited by rtrethewey; 10-18-2012 at 02:53 PM.
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Mar 2009
    Posts
    22
    OK, so I created a .htaccess file and placed it in the root of my site directory. What I entered in the file is as follows from a random tutorial site: (replacing XXX with my old address and YYY with my new one)
    <IFModule mod_rewrite.c>
    RewriteEngine on
    Options +FollowSymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} XXX\.com
    RewriteRule ^(.*) http://www.YYY.com/$1 [L,R=301]
    </IfModule>

    For now my new domain name is purchased, but not set up yet, so I just replaced what the new one should be with google.com for now. Technically speaking, when I enter my old domain in my browser window, I should be redirected to google correct? Unfortunately though when I enter the address in my browser I get a error:

    Server error!

    The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

    Error 500

    That is my first problem. My other problem is how to set up my new domain name to point to my existing site on my computer (just like my old one has been)? I would assume that I would have to open another DynDNS account and point my new name to my computer just like i originally did with my old name. Is this the correct missing step that is confusing me?

    It seems logical that this is what I need to do and if I am correct it should work as follows: the user enters my old domain name in a browser. It, behind the scenes, directs them to my ip address and reads the .htaccess file which sees that they are looking for my old name and then redirects them to my new name. my new name directs them to the same ip address and reads the .htaccess file again, this time sees that they are looking for my new name and lets them continue to view the site. If a user enters the new name directly it "skips" the .htaccess redirect and lets them continue on to view the site. Am I correct on my assumptions of how this would work?
    If this is the case then, what is the point of using the .htaccess file then? These 2 DynDNS accounts would essentially point both old and new names to the same physical site. The users would be reaching the same site regardless of which domain they entered or searched for.

  4. #4
    Join Date
    Mar 2011
    Posts
    1,139
    I'm not an .htaccess expert, but try:
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine on
    Options +FollowSymlinks
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^XXX.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.XXX.com$
    RewriteRule ^(.*)$ http://www.YYY.com/$1 [L,R=301]
    </IfModule>
    Rick Trethewey
    Rainbo Design

  5. #5
    Join Date
    Aug 2012
    Location
    1453 Gingerwood ave, Milpitas CA 95035,
    Posts
    37
    Agree with "rtrethewey"..
    Use 301 redierct. It will be helpful to redirect the trafic of your old domain to new domain.
    Beneficial in both the cases, visitors and crawler.....

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles