301 Redirection Help: I have modified both web.config and htaccess but no Redirect

Discussion in 'Search Engine Optimization' started by Rupam Das, Oct 29, 2011.

  1. #1
    Dear Friends, I am facing the most bizarre of the problems and any help is much appreciated.

    INFO:

    my domain is grasshoppernetwork.com and i want to permanently redirect it to www.grasshoppernetwork.com
    My server is hosted in shared hosting in windows II7 Server. I am hosting a MyBB forum in the base domain.

    Here is my Web.config file snippet

    
    <rule name="Redirect domain.com to www" patternSyntax="Wildcard" stopProcessing="true">
                <match url="*" />
                <conditions>
                  <add input="{HTTP_HOST}" pattern="^grasshoppernetwork.com$" />
                </conditions>
                <action type="Redirect" url="http://www.grasshoppernetwork.com/{R:0}" redirectType="Permanent"/>
              </rule>
    
    Code (markup):
    I have put that in wwwroot and also the hosting folder. But it does show 200 response code for

    grasshoppernetwork.com returns a 200 (OK) response.
    www. grasshoppernetwork. com returns a 200 (OK) response.
    grasshoppernetwork.com/index.php returns a 200 (OK) response.
    www. grasshoppernetwork.com/index.php returns a 200 (OK) response.

    So I also Modified My htaccess. Here is the snippet
    
    RewriteEngine on
        RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
        RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]
    
    
        RewriteCond %{HTTP_HOST} ^grasshoppernetwork.com
        RewriteRule (.*) http://www.grasshoppernetwork.com/$1 [R=301,L]
    
    
    
    Code (markup):
    Still the same problem. Have I gone wrong somewhere? Can somebody please help me?
     
    Rupam Das, Oct 29, 2011 IP