Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > 404 Handler and Friendly URL View modes: 
User avatar
Member
Member
envisasoft-msn - 8/1/2011 12:23:20 PM
   
404 Handler and Friendly URL
I am having trouble getting the "CMSPages/handler404.aspx" to be called when i have a url which looks like "http://localhost:12345/kentico/test" or "http://localhost:12345/kentico/123". Instead it redirects back to the home page. I have turned on the custom errors in the web.config, I have tried changing the Friendly URL setting, but no combination of things will cause the page to be called. Thoughts?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 8/2/2011 6:00:49 AM
   
RE:404 Handler and Friendly URL
Hello,

What version of IIS do you use? If it is II7 or higher, please try to setup your application the following way: Setting up the extension-less URLs.

Please let us know if it helps.

Best regards
Ondrej Vasil

User avatar
Member
Member
envisasoft-msn - 8/2/2011 9:27:02 AM
   
RE:404 Handler and Friendly URL
I should have mentioned that I am not using IIS at all. I am sing the built in Casini web server that comes with VS. The article you mentioned, I have read and tried. No luck. It's like the handler404.aspx is ignored completely and the 404 response is simply redirected to the home page. I set a break point in teh code behind for the page and it never hits it. Other thoughts?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 8/4/2011 2:46:49 AM
   
RE:404 Handler and Friendly URL
Hello,

Extension-less URLs shouldn't be any problem even on Cassini. Please check what you have set for the Page not found URL option in Site Manager -> Settings -> Your_Site -> URLs and SEO. I tried it on my site and if the extension-less URLs are set in the web.config file (as described in that article I sent previously), I'm correctly redirected to a chosen page after 404 response.

Best regards
Ondrej Vasil

User avatar
Member
Member
envisasoft-msn - 8/5/2011 2:02:28 PM
   
RE:404 Handler and Friendly URL
OK - So i pulled up another CMS site and it works fine. So I compared the settings between the 2 sites and made sure that the one not working matched the site that does work. The only difference between the 2 sites is that the one that does not work has a newer update applied (5.5.4216.158 versus 5.5.4175.18340) and the connection strings. When I put in an invalid url in the problem site, the nicely formatted 404 page does not appear; it redirects to the home page. If I toss in a url with say blah.aspx, the nicely formatted page does appear. It's only the extentionless urls.

The values in the Friendly URL extensions and File friendly URL extensions both have ".aspx" in them. This to me would mean that an extensionless url would be redirected to the 404 page.

User avatar
Member
Member
envisasoft-msn - 8/8/2011 11:31:38 PM
   
RE:404 Handler and Friendly URL
Good news!!! I found the problem. It appears that if you have a application path that contains ".com" or something similar in it, any url not found goes directly to the home page. Thoughts on why this is happening?

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 8/12/2011 2:13:36 AM
   
RE:404 Handler and Friendly URL
Hello,

Could you please send us the web.config file to support@kentico.com? We'll inspect it further.

Do you have any customizations regarding any kind of redirection?

Best regards
Ondrej Vasil

User avatar
Member
Member
envisasoft-msn - 8/12/2011 11:51:23 AM
   
RE:404 Handler and Friendly URL
I certainly can send that file to you. I don't think there is anything special; in fact the other project that I was testing with is part of a larger solution with WCF services and those are referenced in the Kentico project (as well as a WinPhone 7 app). What I did to get it working was simply change the folder with the Kentico file in it from "sitename.com" to "sitename". Now it works fine. Email will be following this post to support (with reference to it).

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 8/16/2011 8:16:19 AM
   
RE:404 Handler and Friendly URL
Hello,

You've been discussing this issue with my colleague over e-mails, I'd like to share a conclusion from this ticket. Since we weren't able to reproduce this issue we ended up with the fact that renaming the project folder works in this case.

Best regards
Ondrej Vasil