1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

301 Redirect- How to Canonicalize homepage for windows server/asp?

Discussion in 'C#' started by HighRankingSEO, Dec 9, 2009.

  1. #1
    How do I canonicalize a non www version to the www version of the site...I tried using this:
    http://sitename.com: <%@ Language=VBScript %>
    Response.Status=”301 Moved Permanently”
    Response.AddHeader “Location”, http://www.sitename.com
    Code (markup):
    but that did not work. All I got was some asp error. Also, where do I put the code? I put it in the homepages default.aspx file and also tried putting it in the head of the document but neither worked.

    I have never worked with an ASP site before so I am really clueless on this one. Can someone help me out?

    Thank you.
    HighRankingSEO, Dec 9, 2009 IP
  2. perfect101

    perfect101 Greenhorn

    Likes Received:
    Best Answers:
    Trophy Points:
    Do you have your own dedicated server? If so install and isapi rewrite (helicontech.com), it can handle Canonicalized urls as well as create SEO friendly URLs.

    Once installed just page the following code into the httpd.ini file
    RewriteCond %HTTPS off
    RewriteCond Host: (?!www\.)[^.]+\.[^.]+
    RewriteRule (.*) http\://www.example.com$1 [I,RP] 
    Code (markup):
    If you dont have a dedicated server check with your hosting company and see if they support any isapi rewrite filters.

    Hope this helps!
    perfect101, Dec 9, 2009 IP
  3. HighRankingSEO

    HighRankingSEO Active Member

    Likes Received:
    Best Answers:
    Trophy Points:
    that looks like mod rewrite...where do I put the code in a htaccess or what?
    HighRankingSEO, Dec 10, 2009 IP