My WordPress multisite installation was just fine until today.
This morning, I decided to move the contents of my web-server from /var/www/html/
to /var/www/
.
I grep'd for any files that had /var/www/html/
hard-coded, and dumped my WordPress MySQL database to check for any links to it. The only file I found in /var/www/html/wordpress/
that had it was the WPCACHEHOME
entry in wp-config.php
, so I changed that. The only references in the WordPress database was for the recently_edited
entry, so there was no need to change it.
After moving /var/www/html/*
to /var/www/
and adjusting all of the paths in the Apache config file to point to /var/www/
instead of /var/www/html/
, I restarted the server and checked it. Other webpages are okay, but going to example.com/wordpress/
throws a 403 (forbidden) error.
I checked everything I could think of and did a web-search for "wordpress multisite 403" and checked everything people have suggested (90% were about permissions and 9.9% about .htaccess
), but nothing worked. I gave up and put everything back the way it was, but it's still giving a 403.
I can access admin pages, as well as other blogs (e.g., example.com/wordpress/foobar/
), it's only the primary blog (example.com/wordpress/
) that gives a 403. Even example.com/wordpress/index.php
gives the same error.
Here's what I've checked, tested, tried, and confirmed:
- ✓ Browser cache cleared
- ✓ Owner and group of
/var/www/
and everything under it iswww-data
- ✓ Permissions of all directories under
www
are 775 - ✓ Permissions of all files (that should be accessible) under
www
are 664- (No, setting them to 755 and 644 respectively won't fix it.)
- ✓ Apache service has been restarted
- ✓ Apache config file is correct
- ✓ Web-server has been rebooted
- ✓
wp-config.php
is correct - ✓ All paths include trailing slash (
/var/www/html/
) - ✓
.htaccess
hasn't been modified, but I tried renaming it anyway, as well as replacing it with a new, confirmed-correct copy for WPMU - ✓
wordpress/index.php
is indeed present and unmodified - ✓ WordPress database has not been touched since it was last working
- ✓ No changes made to WPMU format (subdirectories/subdomains)
- ✓ The only files under
wordpress/
that were modified arewordpress/wp-config.php
(restored) - ✓ The directories in
wordpress/wp-content/cache/
were deleted (blogs
,autoptimize
, andsupercache
) but recreated with correct permissions and owners (Autoptimize recreated directories and files in its folder) - ✓ There are no directories with the same name as the problem blog (it's the primary blog so what would that even be,
/var/www/html/blogs//
? 🤨)
Does anyone have any ideas about what could be the problem or suggest things to try?
DirectoryIndex
is already being used and is set correctly, so I looked atDirectoryIndexRedirect
. I tried a few settings and it started working when I set it tooff
. This is confusing because it used to work without it, and the other blogsexample.com/blogs/foobar/
worked without it. 😕 I'll monitor the situation for a while and see what happens.DirectoryIndex
point to a real file and if so, which one?