301 redirect - .html extension

Discussion in 'HTML / PHP / JavaScript / CSS' started by mfox, Mar 3, 2010.

  1. I've restructured my site and want to redirect (301)
    From: www.mysite.com/index.html
    to: www..mysite.com/web/index.html

    Unfortunately since the file has a html extension I can't do the redirect from a script in the file. How can this be accomplished considering the file extension?

    Mike

    P.S. At one time I was looking into having htm and html files extensions processed as traditional asp. Is that the best option? If so, would an Admin please configure my account?
     
  2. Hi,
    If you want I can write an ASP file, default.asp, that you can place in the root.
    Then in the Control Panel you will need to make sure it is in your list of default files.
    Once it resides in the root of your site it can redirect traffic for you.
    You can do this with ASP or ASP.NET, works the same in both and is very quick.
    All the best,
    Mark
     
  3. Thank you very much for the kind offer.

    The problem is that Google has already ranked "index.html" because that's what is there now. I want to do a 301 redirect of the html file because that's the file extension search engines will be looking for. In that case where the url is specifically "index.html", having index.asp won't help will it? The server will return 'page not found'.
     
  4. Hmmm...MJP may have a trick or two for you.
    If I think of anything I'll repost.
    All the best,
    Mark
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    are you hosted on IIS 6 or IIS7? If you are hosted on IIS7, you can use URLRewrite to do that.
     
  6. IIS 6

    Can I get upgraded to 7?
     
  7. I found the IIS 7 upgrade page. I'll have to test first. Is there no way for me to do this .html/.htm 301 redirect with IIS 6?
     
  8. mjp

    mjp

    You can do it with IIS6, it's just easier with IIS7, since the IIS Manager (which can only be used with IIS7) has a URL Rewrite module.
     
  9. How do I do it with 6?
     
  10. Bruce

    Bruce DiscountASP.NET Staff

    You request support to map .html to the ASP ISAPI filter. This basically tells IIS to treat .html as an ASP page.

    I recommend you test it first thought.
     
  11. Will do. Thanks Bruce. I'm testing it right now. Looks ok.
     

Share This Page