Wordpress shows 404 for new sites

Discussion in 'Installation/Configuration' started by inflac, Oct 7, 2021.

  1. inflac

    inflac New Member

    Hello, unfortunately I have a problem with my Wordpress instalation on ISPConfig3. Whenever I create a new page and want to go to it, I get the error 404. Only the start page works.
    I had the feeling that this is due to the permalink structure, but it doesn't help if I save it again. My current thought is that something is wrong with the .htacces. The current content is:

    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    </IfModule>

    The content corresponds to the standard configuration.
    The .htacces is located in: / var / www / clients / client1 / web1 / web / wp-content / wflogs

    I would be really happy if someone can help me with the problem. If I am out of place here with my request, I am sorry.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I have installed wordpress on default ISPConfig website with zero modifications, not even to .htaccess (WP install does something to it, never have checked what is does). Works every time.
    How exactly are you installing wordpress?
    Or do you mean you have wordpress already installed and working, but creating a new page in wordpress does not work?
    You could start with https://www.howtoforge.com/community/threads/please-read-before-posting.58408/
     
  3. brainsys

    brainsys Member

    There should be an .htaccess file in your wordpress root directory / var / www / clients / client1 / web1 / web / . Mine looks like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    BTW it is good practice to put Wordpress in its own sub-directory. You copy index.php to doc root and do one edit plus change the address in the Wordpress admin CP. It will then answer to https://yourdomain.tld/ and not https://yourdomain.tld/sub-directory

    Google for details next time you create a wordpress site..
     
    Last edited: Oct 7, 2021
  4. inflac

    inflac New Member

    I do not really k

    I have already successfully installed wordpress, but I have problems with the additional pages created (in Wordpress).
    There i get only what you can see on the picture
     

    Attached Files:

  5. brainsys

    brainsys Member

    This is the behaviour one would expect if there is a missing or incorrect .htaccess. Do you have one in document root? If so, can we see it? The one in wflogs is not relevant.

    Thie .htaccess should have been created automtically by the wordpress install. Were you following the '5 minute tutorial'?
     
  6. brainsys

    brainsys Member

    This is how I install wordpress on ISPConfig:
     
  7. inflac

    inflac New Member

    No i do not have a .htacces file in my document root. And also after saving the link strukture there was no file created. I have now manually created a .htacces, but still without success
    I did not followed the five minute tutorial, what is it?
     
  8. inflac

    inflac New Member

    That is also the way i did it. May i delete my wordpress and reinstall it?
     
  9. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    It could be with a quick check to verify you are using the apache web server, as .htacess files don't work on nginx.
     
    inflac likes this.
  10. inflac

    inflac New Member

    Oh okay, thats a good point. No i am using nginx. Is there a similar file? or any other possible solution?
     
  11. brainsys

    brainsys Member

    Your first post mentioned: / var / www / clients / client1 / web1 / web / wp-content / wflogs

    This suggest that wordpress is sitting in your document root and not, by default, in the wordpress sub-directory created when you unzip the download. The missing .htaccess is, I fear, the root of the problem and may have disappeared when you moved the wordpress files to root. the mv wordpress/* ./ command doesn't move hidden files. Fot that you have to add mv wordpress/.* ./.

    Unless you understand fully the Apache directives in it - (and few do) - it may be best to start again unless that .htaccess is still lurking in the wordpress/ directory. Try ls -la wordpress if wordpress still exists.

    However you now see why its best to keep wordpress in its own sub-directory. You could then do a simple rm -r wordpress/. Whereas you now have to unpick the individual wordpress directories and files or you would also wipe out stats and error plus any other stuff you might in future choose to run under the same domain (like a forum or wiki).

    EDIT IGNORE THIS. I was assuming you were using apache. It's always good to quote the os/ispconfig setup plus any variations or options from the Perfect Tutorial.
     
  12. inflac

    inflac New Member


    Thank you, that was helpful. But now i am a little bit confused. Is there a .htacces or not, because i use nginx?
    I think i will reinstall everything.
     
  13. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    For nginx, you have to paste some directives into the site options, search the forums here for examples (@till posts them somewhat regularly).
     
  14. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If @inflac had followed my advice which inflac even quoted, it would have been revealed nginx is in use and not apache, and this thread would have been solved in fewer messages.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

Share This Page