1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to redirect www.site.com/default.aspx to www.site.com its asp.net site

Discussion in 'White Hat SEO' started by rushi, Jul 27, 2009.

  1. rushi

    rushi Registered Member

    Joined:
    Feb 2, 2008
    Messages:
    71
    Likes Received:
    54
  2. Bacanze

    Bacanze Junior Member

    Joined:
    Nov 12, 2008
    Messages:
    150
    Likes Received:
    49
    Occupation:
    Uni student
    Location:
    UK
    Haven't test, put this in your .htaccess file:

    Code:
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*default\.aspx\ HTTP/
    RewriteRule ^(([^/]+/)*)default\.aspx$ http://www.example.com/$1 [R=301,L] 
     
  3. rushi

    rushi Registered Member

    Joined:
    Feb 2, 2008
    Messages:
    71
    Likes Received:
    54
    hi,

    .htaccess wont work in IIS servers
     
  4. Bacanze

    Bacanze Junior Member

    Joined:
    Nov 12, 2008
    Messages:
    150
    Likes Received:
    49
    Occupation:
    Uni student
    Location:
    UK
    Ah yeah, sorry I'd just woken up when I posted that.

    Anyway if I remember in ASP.NET, in the page load event handler of your index page, something like

    Code:
    Response.Status = "301 Moved Permanently";
    Response.AddHeader("Location","http://www.website.com");