views:

694

answers:

1

I am using Sitecore as a CMS solution. Recently, we decided to add redirect capability to our website for errors. In Sitecore, I have created two content pages, one to handle Server errors and another to handle 404 errors. I implemented the server error with basic sublayouts without any code behind. On the other hand, the 404 page had a sublayout that allows to display the link that was typed that resulted to the 404 error. I then proceeded to add these pages into the web.config file (I edited the customErrors setting to redirect to the Server errors page and the 404 errors to redirect to the 404 error page. I also replaced the NoItems settings to point to my 404 error page.

In addition, I changed the HTTP Error 404 to point to my new 404 error page in IIS (5.1). Lo and behold, my changes worked; I was able to redirect many of the errors to these new pages. However, what I found out is that by forcing IIS to redirect to my aspx page for 404 errors, My website now features extensionless URL redirecting. (Previosly if I typed http://mywebsite/foo, I will get a 404 error. Now after doing all of this, it gets me to the foo.aspx page)

  1. Can anyone explain this behavior? Any plausible explanation will let me sleep at night.

  2. Should I go ahead and use this as a temporary solution for Extensionless URL redirecting? What could be wrong with this solution?

+3  A: 

Look for this in the web.config in the linkManager section:

addAspxExtension

Is that set to true? If so, then this is a sitecore setting you would have to change.

JB King
So if this is set to true, then Extensionless URL works? I have mine set to true so I'm assume that is what you mean.
johnofcross
No, if you set that to true, it will "Add Aspx Extension" which isn't what you want from your initial post.From the web.config file itself: "If you set this to false, remember to configure IIS to map all requests (*) to ASP.NET"
JB King
If anyone is interested, and has a Sitecore account, there is a more current discussion related to this issue: http://sdn.sitecore.net/SDN5/Forum/ShowPost.aspx?PostID=19304
johnofcross