WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 404 on all WordPress pages (7 posts)

  1. rhiannon-ppl
    Member
    Posted 2 years ago #

    When I first set up this multisite installation, I set it up so that the main site of the installation was a static page to avoid disturbing our existing site. I did this using a theme containing an index.php which linked to the existing static pages. I've been preparing a new site in the background and now I'm trying to replace the static page with the new WordPress site.

    I exported the site I'd been creating, and imported all the pages and posts into the main site. I then changed the theme from the static-page theme to the one I wanted to use. I was expecting that this would make the new site public. However, not only is it still showing the old page, but all the other sites are now giving 404s.

    Restoring the .htaccess from backup doesn't seem to help. Reverting the theme doesn't help either. I must have accidentally changed something else, but no idea what! Any suggestions?

  2. luckdragon
    Member
    Posted 2 years ago #

    did you accidentally change the way your permalink structure is setup? or maybe you just need to set the permalink structure.. sometimes turning it off and then back on fixes the 404 issues

  3. rhiannon-ppl
    Member
    Posted 2 years ago #

    Thanks for your suggestion! I've tried changing the permalinks (on all sites) with no effect. Anything else I can try?

  4. rhiannon-ppl
    Member
    Posted 2 years ago #

    Oh, and I've also tried restoring the mysql database from backup, and that didn't help either.

  5. rhiannon-ppl
    Member
    Posted 2 years ago #

    Ah, this might be a clue:

    I had a line in .htaccess to redirect index.html to index.php (to cope with some people's old bookmarks to an old static page). Without it, I should expect a 404 for the non-existent index.html. But if I take it out, I actually get a 404 for index.php. Which means the redirect is still happening. Which suggests that there's some other .htaccess file or something somewhere?

  6. rhiannon-ppl
    Member
    Posted 2 years ago #

    OK, it looks from the error logs as if all requests are being redirected to index.php in my home directory (public_html/index.php).

    I don't see anything that would do this in my .htaccess:

    # These bits make WordPress ignore the specified password-protected directories
    
    ErrorDocument 401 /failed_auth.html
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/(client1|client2|client3|client3|(news|services|careers|clients)\/files|failed_auth\.html).*$ [NC]
    RewriteRule . - [L]
    </IfModule>
    
    # Redirect old intranet bookmarks
    # 301 Redirect Old File
    # Redirect 301 /intranet/index.html http://www.mysitename.co.uk/intranet/index.php
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress
  7. rhiannon-ppl
    Member
    Posted 2 years ago #

    Aha, figured it out. There was supposed to be an index.php in the home directory, containing calls to WordPress functions, but it didn't exist. Restored it and all works fine again.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.