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

    Does anyone know what is happening here? i have a site with an error page setup in the MODx manager and my configuration set to display it when a rogue url is typed in - this all seems fine in principle - but the page is not loading... It loads fine if you view it directly with the name of the file (not I have SEO friendly URLs on) but if you type in a junk URL in Firefox you see fragments of the HTML code and in Safari / Chrome you get a "cant find this page" error...

    I am using v1.0.2


    Any ideas? Error page is here - http://www.sportingfish.co.uk/error.html and odd page can be seen here or any other junked url at this domain http://www.sportingfish.co.uk/errr.htmls

    Is this a server setting? I have the same thing working on other hosts???


    Cheers

    dubbs
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      What plugins/snippets are you using on your site or on that page? PHx per chance?

      To start testing this, I’d try using a simple "hello world" error page with a blank template....
        • 8168
        • 1,118 Posts
        No use of PHx no.. I will try an empty template to see if that makes any odds... Thanks
          • 8168
          • 1,118 Posts
          Still same issues...

          http://www.sportingfish.co.uk/error.html is the error page correctly formated with a blank template

          try a junk url http://www.sportingfish.co.uk/errorasdasd.html - gets you nothing.... huh?


          Is there a more reliable way to do this with the .htaccess file?
            • 9207 ☆ A M B ☆
            • 2,475 Posts
            That’s not quite what I meant... try putting up a simple "Hello World" as the SOLE content of your 404 page... if that works, then start adding in bits of your html, bit by bit into a page with a blank template (for simplicity). If you’ve got a bad bit of javascript in there or something, it could thwart your page load.

            So you have no active plugins at all? Are you logged into the manager when you’re testing this?
              • 9207 ☆ A M B ☆
              • 2,475 Posts
              You may try using the following in your head:

              <base href="http://www.sportingfish.co.uk/" />
              
              <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
              <link href="assets/css/core.css" rel="stylesheet" type="text/css" />
              <link href="assets/css/author.css" rel="stylesheet" type="text/css" />


              After the base-tag has been set, you shouldn’t need to explicitly list the domain for all assets...
                • 8168
                • 1,118 Posts
                Thanks Everett,

                Was just using full URLs just to test things out as sometimes I was getting the page to load but without the CSS so dropped in the full path to make sure it was not this that was the issue.

                Still does not seem to work - think the host does not allow custom error pages... which sux!


                Any other ideas?

                Cheers


                dubbs
                  • 9207 ☆ A M B ☆
                  • 2,475 Posts
                  So what do you seen when your 404 page uses a blank template and has simple text in it? Anything? Presumably you can preview the page normally, but what happens when you type in a bad URL?

                  It is possible that the host is intercepting 404’s at a level above the level of your MODx app... you should confirm that with the host. But it seems unlikely if you were at least getting SOME parts of your page to show. Usually a global 404 would just show its own page, not just half of yours. That’s why I want to see the results of a simplified page without any html or javascript that might interfere.

                  Are you using anything special in your .htaccess files?

                  You should try deploying this site’s code on a different host to see if the results are any different.

                  Everett
                    • 8168
                    • 1,118 Posts
                    Everett,

                    Have tried your blank page idea here - http://www.sportingfish.co.uk/blankerror.html this is the direct path to the file and try any junked URL and you will just get an empty page.... It would seem that is the hosting that has some odd setting going on here... Not sure they allow custom Error pages...

                    I have looked around the cPanel and set up custom error pages to a url I have identified but its not working as you can see by typing in any junk url to the domain www.sportingfish.co.uk


                    Thanks for your replies so far - any other ideas?

                    HTACCESS file is just as below:

                    # Vital components of your .htaccess file
                    RewriteEngine On
                    RewriteBase /
                    
                    # Force “www.yourdomain.com” instead of just “yourdomain.com”
                    RewriteCond %{HTTP_HOST} .
                    RewriteCond %{HTTP_HOST} !^www\.sportingfish\.co.uk [NC]
                    RewriteRule (.*) http://www.sportingfish.co.uk/$1 [R=301,L]
                    
                    # The Friendly URLs part
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]




                    Cheers
                      • 9207 ☆ A M B ☆
                      • 2,475 Posts
                      Well something funny is going on there. The http://www.sportingfish.co.uk/blankerror.html doesn’t REALLY exist... it’s just passed along to the MODx app to see what to do with it, and MODx renders it. The junk pages should be the same: they should be passed on to MODx, and MODx should handle it.

                      Just to absolutely certain, you’ve set this up inside the config so that MODx points to this page as its 404?

                      I’d try this on another host, mate.