Please help me about 301 redirect.Please...

3 replies
I have a host and domain with godaddy..
I want to create global.asax file for 301 permanent redirect.But I don't know anythink.
This morning I looked my site and google punished my site for duplicate content.
I want to redirect http://xxxx.com to http://www.xxxx.com

Can anybody help me.I am difficult situation...
#301 #redirectplease
  • Profile picture of the author lisag
    Originally Posted by alkantenik View Post

    I have a host and domain with godaddy..
    I want to create global.asax file for 301 permanent redirect.But I don't know anythink.
    This morning I looked my site and google punished my site for duplicate content.
    I want to redirect http://xxxx.com to http://www.xxxx.com

    Can anybody help me.I am difficult situation...
    Try this:

    Code:
     if  (HttpContext.Current.Request.Url.ToString().ToLower().Contains(
    
        "http://xxx.com"))
    
    {
    
        HttpContext.Current.Response.Status =
    
            "301 Moved Permanently";
    
        HttpContext.Current.Response.AddHeader("Location",
    
            Request.Url.ToString().ToLower().Replace(
    
                "http://xxx.com",
    
                "http://www.xxx.com"));
    
    }
    Signature

    -- Lisa G

    {{ DiscussionBoard.errors[1876491].message }}

Trending Topics