We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21122
    • 153 Posts
    Hi there,

    I’m trying to get a custom 404 error page to work, but not having any luck.

    I’m using ISAPI rewrite to handle my Friendly URLs, and am on a IIS 6 server.

    In IIS, I’ve got the 404 page directed to /index.php, and in MODx I’ve got the error page set to go to the id of the error page I’ve made in MODx.

    For some reason, when the wrong URL is typed in, I just get a blank page.

    Any ideas on how to get this working?

    Thanks
      • 37550 ☆ A M B ☆
      • 711 Posts
      Hi,

      What happens when you unset the 404 error page in IIS and just set it to default?

      Could you also paste your ISAPI Rewrite rule for me to see as well?

      Thanks Aaron
        http://www.onesmarthost.co.uk
        UK MODX Hosting with love.
        • 21122
        • 153 Posts
        Hi Aaron,

        When I set it to the default 404, I get the default 404 showing. I’ve also tried setting the 404 (in IIS) to me error page (ie. /error.html) but this results in a blank page too.

        ISAPI rewrite is as follows:

        # Helicon ISAPI_Rewrite configuration file
        # Version 3.1.0.69
        
        RewriteEngine On
        RewriteCompatibility2 On
        RepeatLimit 32
        RewriteBase
        
        #  Block external access to the httpd.ini and httpd.parse.errors files
        RewriteRule ^/httpd(?:\.ini|\.parse\.errors).*$ / [NC,F,O]
        #  Block external access to the Helper ISAPI Extension
        RewriteRule ^.*\.isrwhlp$ / [NC,F,O]
        
        RewriteRule ^/(?!(?:manager|assets)/)(.*)\.html(?:\?(.*))?$ /index.php?q=$1?2&$2: [NC,L,U]


        Thanks
          • 21122
          • 153 Posts
          Turns out that I’m just behind a proxy server here at work, so thats why it wasn’t working for me. Works everywhere else!

          Thanks to Aaron at onesmarthost.co.uk for helping me realise this!