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.
<customErrors mode="RemoteOnly" />
Then the final touch.
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/error.aspx"
</httpErrors> <!-- <httpErrors existingResponse="PassThrough" /> -->
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.
Here's a few references: