There are times when we need to change domain names only while the contents are the same still. If you were to do remove your url and resubmit it to Google Webmaster Tools, all your page-ranks you have had will be gone because you have just moved to a new domain name. So how can you tell Google about this change?

Solution:
Simply do a 301 Redirect from your old domain name to your new domain name. It doesn’t matter you are just changing between the sub-domain names, or between the new domain names. So long as it is telling Google that you have permanently moved to a new domain name, that’s the important point.

Try not to use Meta Refresh as possible.  I heard that Google don’t like to use that due to a technique used for spamming  Search Engines.

How to do it for Unix/Linux:
Look for .htaccess in your directory where your webpages are resided. If it is not found, create a new file called “.htaccess” then. Put in the following line inside:

redirect 301 /directory/file.html http://www.domainame.com/directory/file.html

And you are done. Do a test with your old domain name, and see if it redirects to your new domain name. Keep the old redirect for probably at least 1 month to let search engines and your visitors know of your domain moving.

How to do it for Windows:
Place the following code above your <html> tag or <!DOCTYPE>, if you have one:

<%@ Language=VBScript %>
<%
response.status="301 moved permanently"
Response.AddHeader "Location", "http://www.domain.com/file-location.html"
%>

If you are using .asp.net pages, the code should look like:

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
response.status = "301 moved permanently";
Response.AddHeader("Location","http://www.domain.com/file-location.html");
}
</script>

The URL after “Location” should be the exact location to which you want the page to redirect.


  • Some Other Posts You Might Be Interested:

  • Add to Onlywire Add to Onlywire

    RSS feed | Trackback URI

    Comments »

    No comments yet.

    Name (required)
    E-mail (required - never shown publicly)
    URI
    Subscribe to comments via email
    Your Comment (smaller size | larger size)
    You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.