Defaul 404 Page (Wordpress)

Discussion in 'Installation/Configuration' started by Jeremy007, Mar 11, 2018.

  1. Jeremy007

    Jeremy007 Member

    Hello Friends,

    Does anyone know how to get nginx to load Wordpress' default 404 page? Currently it keeps loading the standard ispconfig 404 pages.

    I have searched the forum and found a couple threads with the same subject matter but none of the answers seem to solve my issue. I have tried many " location /{ index index.php..." configurations but none of them seem to solve the problem either.

    Any kind of help will be greatly appreciated.
     
    Last edited: Mar 14, 2018
  2. Jeremy007

    Jeremy007 Member

    No-one using ispconfig with WordPress??
     
    Last edited: Mar 14, 2018
  3. Ghostdare

    Ghostdare Member

    We are using WP, but we let the default pages or customized ones.
     
  4. Jeremy007

    Jeremy007 Member

    Noone else attempted?
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Have you set in ISPConfig the "Own Error-Documents:" for that website? That should enable you to copy the error pages you want to the custom location.
    In what way is your issue different from the others discussed in the forum?
     
  6. Jeremy007

    Jeremy007 Member

    Yes i have that option checked. The problem is i am trying to load wordpress's 404 page instead of my custom ispconfig 404 page. It's important because it allows me to create a dynamic 404 page.
     
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    So you just need to uncheck that and it will work how you want?
     
  8. Jeremy007

    Jeremy007 Member

    Also did that. Unchecking that option makes the site load the global ispconfig error pages instead of site specific custom ispconfig error pages. So strange, with webmin it works the way it's supposed to.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you set your custom error page URL's with the ErrorDocument directive in the nginx directives field? When the ISPConfig custom error pages are disabled (which set ErrorDocument), then the default ones from nginx will kick in unless you define your own ones like:

    ErrorDocument 404 /my/404/error/url.htm
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Or a more general question, which directives did you set for WordPress in the nginx directives field at the moment. It might be that some other directives might work as well, not just the ErrorDocument handler.
     
  11. Jeremy007

    Jeremy007 Member

    I haven't defined any error pages or error page locations
    My Nginx directives setting :
    Code:
    location / {
        try_files $uri $uri/ /index.php?$args;
    }
    
    # nginx configuration
    
    location / {
      if (!-e $request_filename){
         rewrite ^(.*)$ /index.php break; {DOCROOT}
       }
    }
    
     
  12. Jeremy007

    Jeremy007 Member

    Finally it works! So silly, i discovered a "mydomain.com".err file inside my nginx "sites-available" directory and came to the conclusion that my settings were no good. I removed all incorrect lines/text from the "options" tab in my site's "nginx directives" settings and unchecked "Own Error-Documents". Thanks guys, you led me in the right direction.
     
    Last edited: Mar 15, 2018
    till and Jesse Norell like this.

Share This Page