Home>Support>Custom 404 Page

Custom 404 Page

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi,

I’ve made changes to my membership site: When a user signs up and logs in, certain public pages will be hidden from them, as they are suppose to navigate forward and view the member pages. This works smoothly most of the time, except if a user hits the back button (or manually enters a URL) and tries to access the pages they already visited before logging in or signing up. They would then see a 404 page if viewing a public page (now hidden from them).

I’d like to create a custom 404 page with some useful links and a message letting them know where to go.

I have a child theme and can add 404.php to it for editing. But, I was curious if you guys have a template with all of the page items removed (search bar, categories, tags, etc)? This would be easier for me to use to edit.

My 404 page would simply need to contain a few sentences and links.

URL: https://rockclass101.com/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 9 months ago hardel

    I have redirection plugin installed. If it is easier to use that to redirect to a page I create, I am open to that as well.

  2. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Hi hardel

    Using redirection would indeed be easier than editing the 404 template in your child theme. When adding a new redirect under action you can choose 404. Let me know how that goes.

  3. 9 years, 9 months ago hardel

    Hey Andrew,

    How do I set up the 404 redirect? I tried to, and it did not work.

    I’d like to redirect to this page for all 404 errors: https://rockclass101.com/404-error-page-not-found/

    The options in redirection are:

    Source URL: (blank)

    Match:
    1) URL Only
    2) URL and referrer
    3) URL and user agent
    4) URL and login status

    Action: Error (404) – as you stated to use

    Regular expression: (check or leave unchecked?)

    Group:
    1) Redirections
    2) Modified Posts

  4. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Sorry, taking a harder look now I’m not sure Redirection can make this change for us.

    Perhaps this plugin will help?

    https://wordpress.org/plugins/custom-404-pro/

  5. 9 years, 9 months ago hardel

    Andrew,

    Can you help me with a manual edit or redirect? Is it possible to place a code in the child theme 404.php to redirect to a custom page I made? Or can we add a code line to my htaccess file to do this?

    I realize I can edit the child 404.php file, but I would prefer to use the page builder layout for a nicer 404 page appearance.

  6. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    You can edit your htaccess file and set it that way for sure:

    http://www.thesitewizard.com/archive/custom404.shtml

  7. 9 years, 9 months ago hardel

    Htaccess will not work b/c of WP overwrite rules.

    So the solution was to create a child theme 404.php and input the following code. Hope this helps someone, as it is extremely useful since my site is a business, I need a custom error page to help redirect logged in/out members.

  8. 9 years, 9 months ago hardel

    Here is the link for the code: http://webmaster.iu.edu/tools-and-guides/maintenance/php-redirect.phtml

  9. 9 years, 9 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for sharing your process here. Glad to hear you were able to resolve in the end.

    All the best.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More