Results 1 to 11 of 11

Thread: [RESOLVED] 301 Redirect

Threaded View

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Resolved [RESOLVED] 301 Redirect

    Hey I have a website which is hosted externally the primary domain is www.speak-weather.com however I have since bought a new domain name www.cyprusstairlifts.com which points at the same directory and default page.

    I now have two problems firstly I want all traffic to come to my new domain and not the old one both users and search engines.

    Secondly i have noticed in my google stats it records visits to my site as
    cyprusstairlifts.com rather than the full name, again for reporting purposes it would be best if these also were reported as the full name.

    I am thinking the code below added to each page on my site is the answer but wanted to check if there are any pitfalls.

    If it wasnt my site wasnt hosted under the original name then I would disgard the speak-weather domain altogether.

    Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
        'Put user code to initialize the page here 
    
        Response.Status = "301 Moved Permanently"
    
        Response.AddHeader("Location", "http://www.cyprusstairlifts.com/")
    
    End Sub
    Last edited by FishGuy; Oct 19th, 2010 at 10:20 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width