+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom 404 with Extensionless URL

Custom 404 with Extensionless URL

12 posts, 0 answered
  1. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    08 Nov 2010
    Link to this post
    Hello,

    Just trying to create a custom 404 page for a website. It's using extensionless urls and multiple languages is turned on. For some reason I keep getting the default IIS 7 404 message regardless of what I do.

    Currently the web config has this:

    <customErrors mode="RemoteOnly" defaultRedirect="~/404.aspx">
                <error redirect="~/Sitefinity/nopermissions.aspx" statusCode="403"/>
                <error redirect="~/404.aspx" statusCode="404" />
            </customErrors>

    I've tried it with or without the ".aspx" and no luck. I've created a page called 404 with the proper messaging. What am I missing?
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Nov 2010
    Link to this post
    Hello KMac,

    If you are using physical files for your error page and you are using PathPrefix localization mode you should create a sub directory on your site with for each of your languages. For example for English it would be en, and then copy the 404 page there.

    You can also try to make those pages as part of your sitefinity website and mark them as non navigable. Then you will be able to refer them as:
    <customErrorsmode="RemoteOnly"defaultRedirect="Error-404">
    <errorstatusCode="403"redirect="Error-403"/>
    <errorstatusCode="404"redirect="Error-404"/>
    </customErrors>

    Note that Error-403 and Error-404 are pages in the Sitefinity website's root and no extensions are used since the site is set to be extensionless.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    08 Nov 2010
    Link to this post
    Sorry, I didn't mean that I created physical files. I created a page in Sitefinity called 404 so "~/404", but it's not working. Just redirects instead to the IIS default 404.
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Nov 2010
    Link to this post
    Hi KMac,

    Can you try without the ~/ in front of the page name?

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    08 Nov 2010
    Link to this post
    Hey Radoslav,

    Unfortunately the same thing. I tried "404.aspx" and "404". Neither worked.
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Nov 2010
    Link to this post
    Hello KMac,

    Can you please show us a screenshot of the IIS error page? It might be the case where IIS is not mapping the request properly, and it never reaches the website's custom errors configuration.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    08 Nov 2010
    Link to this post
    Here you go
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    09 Nov 2010
    Link to this post
    Hello KMac,

    Thank you for getting back to me.

    The error message is thrown from the StaticFile handler. It is not reaching the Sitefinity website at all. Can you please try going to your IIS manager and opening the Error Pages section in your website. Then click edit feature permissions after you have selected the 404 response code. Make sure that the Custom error pages radio button is selected, you can refer to attached image.

    Best wishes,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. KMac
    KMac avatar
    133 posts
    Registered:
    15 Dec 2008
    09 Nov 2010
    Link to this post
    Thanks for the help. It turns out that you can't use extensionless URLs with 404 messages. At least not at Discountasp. All is working now.
  10. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    25 May 2011
    Link to this post
    It also appears that IIS6 is also having issues with extensionless urls for the custom 404. If I don't setup anything in IIS for the 404 error, it just goes to the default IIS 404 html page. When I go in and tell IIS to use the page I created in sitefinity, "/page-not-found", then I get a different error. This error seems to be related to IIS not knowing what to do with the extenionless page. Edit: The error I am getting is the following "The system cannot find the file specified."

    We have our development server running IIS6. I thought 4.x was suppose to handle this. Do we need to add something to IIS, or do we have to add in the extension? I already have a wildcard mapping set to the microsoft.net 4.0 framework and it is still not working correctly.

    Just realized this was a 3.x forum and not for 4.x. My issue is related to 4.x
  11. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    19 Jul 2011
    Link to this post
    Hi Team Telerik,

    I think what Richard Baugh is saying is true that IIS 6 cannot is tmanage Extensionless Url and it shows the IIS error page. It works fine on machines with IIS7 and sf version 3.7 sp4 but not incase of IIS6 sf version 3.7 sp4.

    I tried on locahost with IIS7 it works absolutely flawlessly and publish the code to staging server with IIS6, it just breaks.

    Is this something got to do with IIS or with SF.


    Thanks and Regards,
    Siddesh Kapadi
  12. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    21 Jul 2011
    Link to this post
    Hi Siddesh Kapadi,

    I have seen this problem on IIS even on ASP.NET WebApplications so I do not think that it is caused by SF. Please note that IIS 6.0 is old technology when it was made it did not have extensionless pages in mind.

    Regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
12 posts, 0 answered