Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nate 143 posts 184 karma points
    Jan 17, 2011 @ 03:14
    Nate
    0

    Redirect www.mywebsite.com/index.htm

    I built a new website for someone and I want to put in a 301 for their old hompage which is at /index.htm.

    I tried it through the 301 package and the rewriteurl.config but I'm getting a 404 through IIS 7.  I think it's because IIS is trying to find the htm page before it lands to umbraco.

    I'm on softsys shared hosting.  How do I fix this?

    Thanks!

    Nate

  • Nate 143 posts 184 karma points
    Jan 17, 2011 @ 20:09
    Nate
    1

    Figured it out.  Added an index.htm page to my site with the following in it.  If someone can reply and confirm that this is correct I will mark them as answered.

     

    HTTP/1.1 301 Moved Permanently

    Location: http://www.newwebsite.com<html>;

    <head>

    <title>301 Moved Permanently</title>

    <meta

    http-equiv="Refresh"

    content="0; url=http://www.newwebsite.com">

    </head>

    <body>

    <h1>Moved Permanently</h1>

    <p>The document has moved  <a href="http://www.newwebsite.com">here</a> .</p>

    </body>

    </html>

  • Amir Khan 1287 posts 2744 karma points
    Jan 17, 2011 @ 20:37
    Amir Khan
    0

    Meta refresh is a discouraged method for redirecting, breaks back-button, not a 301 redirect, etc... Something like this in your UrlRewriting.config file would be better (NOTE: not 100% sure how this will work on the SoftSys environment, their tech support is helpful though):

    <add name="some_name"
    redirect="Domain"
    ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
    virtualUrl="/index.htm"
    redirectMode="Permanent"
    destinationUrl="/pathToYourDesiredPage" />

    -Amir

  • Nate 143 posts 184 karma points
    Jan 17, 2011 @ 20:48
    Nate
    0

    I have that in my URLrewrite config, but IIS serves up a 404 before it reaches umbraco.  That's my original question.

    If I have

    HTTP/1.1 301 Moved Permanently
    Location: http://www.newwebsite.com

    at the top of my HTML redirect page, will that do the 301?

  • Amir Khan 1287 posts 2744 karma points
    Jan 17, 2011 @ 21:03
    Amir Khan
    0

    I don't think so...Are you getting a 301 header with that method?

    You may have to adjust a setting in IIS to tell .NET to handle the .html file depending on which version of .NET and web.config you are using. I believe if you're using .NET 4.0 Integrated Pipeline and the correct config files you don't have to modify IIS though.

Please Sign in or register to post replies

Write your reply to:

Draft