by      
Redirect older asp and html pages to ASPX in Umbraco CMS For Umbraco users and referencing a few other sites.

Redirect older asp and html pages to ASPX in Umbraco

Once in a great while when I setup Web Config files I forget the order of using custom 404 pages and 301 packages with Umbraco.

I've had to rework a few web.config files in the past and thought it might be time to publish what works on my IIS 7.x system.

Here's the stuff.

You can use On instead of RemoteOnly if you feel better.
It is all about redirecting to your custom Umbraco page. It works very well in both cases.

This will also redirect on a bad folder name as well.

 

  <system.web>
    <customErrors mode="RemoteOnly" />

Then the final touch.

<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Replace">
   <remove statusCode="404" subStatusCode="-1" />
   <error statusCode="404" prefixLanguageFilePath="" path="/error.aspx"
responseMode="ExecuteURL" />
</httpErrors> <!--    <httpErrors existingResponse="PassThrough" />  -->

  </system.webServer>

You don't need to even have a page named error.aspx .

Test it out with my favorite SEO tool website that always seems to be easy to find.. (Guess that's what SEO's do!) http://tools.seobook.com/

That should do the job!

Make sure you have everything in your Umbraco.config setup and your error page number ID properly in place.

Go ahead and test it here.

I want to make sure it works so you can make that perfect SEO website you've been dreaming about.

Murray

Here's a few references:

  1. http://stackoverflow.com/questions/11036508/umbraco-custom-404-error-page-not-working
  2. http://our.umbraco.org/documentation
  3. http://msdn.microsoft.com/en-us/library/h0hfz6fc(VS.71).aspx
  4. http://our.umbraco.org/forum/getting-started/installing-umbraco/18514-404-not-working-with-new-hosting-provider

 

 

Redirect older asp and html pages to ASPX in Umbraco CMS For Umbraco users and referencing a few other sites.