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

    Just wondering if there is a way to redirect '404 Not Found' back to my homepage.

    I currently have the error_page set to 1, which is my homepage resource. Not currently using Friendly URLs.

    Using Modx version 2.2.4-pl

    Why, if your wondering, the website has been closed down so there are still links out there to various pages that no longer exist and the homepage its the landing page I wont all requests to go to.

    Not sure if it matters but the links will point to the domainname/file.asp

    Many thanks

    This question has been answered by sottwell. See the first response.

    • If you have error_page set to 1, and the resource #1 is available, then it will use that page.

      If your site is set to offline, however, unless you have your site_unavailable_page set to #1 then the page can't be accessed (although logged-in Manager users can still view an offline site).
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 40541
        • 85 Posts
        Thanks for replying.

        Please bear with me if my knowledge is incorrect.

        My site_status is set to 1 and the landing page is accessible when going to the domain www.mydomain.co.uk, which is resource 1 (the only resource I have programmed).

        Just can't get the 404 Not Found to redirect back to home if the url is anything other then www.mydomain.co.uk, i.e www.mydomain.co.uk/advertiser/signup.asp
        • What is it doing? Does your site have default .html or .shtml files in the web root?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 40541
            • 85 Posts
            Hi,

            If it helps the url is www.thingstodonearyou.co.uk, just checked and there is nothing like that in the root.

            Thanks.
            • discuss.answer
              You need to enable friendly URLs. It works fine if you use index.php?id=some-outrageous-number.

              With the rewrites enabled, the web server will pass the request on to the MODx index.php file if it doesn't find the file requested (web servers always think a request is for a file). Without the rewrites, it doesn't find blah.whatever, and uses its own Not Found message. [ed. note: sottwell last edited this post 11 years, 6 months ago.]
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 40541
                • 85 Posts
                Thanks for the advise.

                Turning on friendly URL's fixed the problem once I straightened out enabling it from this post http://forums.modx.com/thread/80057/site-url-and-base-url-giving-wrong-url#dis-post-441633