1

I’m having a heck of a time installing multisite WordPress. I have been working on it for about 2 weeks and have hit a number of errors. I’ve perused forums, blogs and help articles, trying any suggestion available. Progress has been made, but it’s not working in its entirety, yet.

URL Info

Environment

  • Gentoo nginx MariaDB WordPress
  • nginx configuration file is in: /etc/nginx/nginx.conf
  • root example.com folder is in: /var/www/localhost/htdocs
  • WordPress is installed in: /var/www/localhost/htdocs/wordpress

Current Problem

Other Current Behaviors

Files

(Sensitive information has been stripped)

nginx.conf

---Code Removed---
http {
---Code Removed---
        map $uri $blogname{
                ~^(?P<blogpath>/[^/]+/)files/(.*)       $blogpath ;
        }

        map $blogname $blogid{
                default -999;
                kevin 2;
        }

        # Redirect all http requests to https
---Code Removed---
        # Adding this to redirect all non-www.-having URLs to www.
---Code Removed---

        # Server settings for all https requests
        server {
---Code Removed---

                root /var/www/localhost/htdocs;
                location ~ ^(/[^/]+)?/files/(.+) {
                        try_files /wordpress/wp-content/blogs.dir/$blogid/files/$2 /wordpress/wp-includes/ms-files.php?file=$2 ;
                        access_log off;     log_not_found off; expires max;
                }

                #avoid php readfile()
                location ^~ /wordpress/blogs.dir {
                        internal;
                        alias /var/www/localhost/htdocs/wordpress/wp-content/blogs.dir ;
                        access_log off;     log_not_found off; expires max;
                }

                if (!-e $request_filename) {
                        rewrite /wp-admin$ $scheme://$host/wordpress$uri/ permanent;
                        rewrite ^(/[^/]+)?(/wp-.*) /wordpress$2 last;
                        rewrite ^(/[^/]+)?(/.*\.php) /wordpress$2 last;
                }

                location ^~ /wordpress {
                        index index.php index.html index.htm;
                        try_files $uri $uri/ /wordpress/index.php?$args;

                        location ~ \.php$ {
                                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                                include /etc/nginx/fastcgi.conf;
                                try_files $uri =404;
                                fastcgi_pass unix:/run/php-fpm.socket;
                        }
                }

                location / {
                        try_files $uri $uri/ /wordpress/index.php?$args ;
                }

                location ~ \.php$ {
                        include /etc/nginx/fastcgi.conf;
                        try_files $uri =404;
                        fastcgi_pass unix:/run/php-fpm.socket;
                }
        }
}

wp-config.php

---Code Removed---
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', '/tmp/wp-debug.log');

/* Always use HTTPS */
$_SERVER['HTTPS']='on';

/** SSL */   
define('FORCE_SSL_ADMIN', true);

/* Multisite */
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'www.draggoo.com');
define('PATH_CURRENT_SITE', '/wordpress/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

/* That's all, stop editing! Happy publishing. */
---Code Removed---

db.wp_options.home

https://www.draggoo.com/wordpress

db.wp_2_options.home

https://www.draggoo.com/wordpress/kevin

db.wp_options.siteurl

https://www.draggoo.com/wordpress

db.wp_2_options.siteurl

https://www.draggoo.com/wordpress/kevin

db.wp_blogs

+---------+---------+-----------------+-------------------+
| blog_id | site_id | domain          | path              |
+---------+---------+-----------------+-------------------+
|       1 |       1 | www.draggoo.com | /wordpress/       |
|       2 |       1 | www.draggoo.com | /wordpress/kevin/ |
+---------+---------+-----------------+-------------------+

.htaccess

I deleted this file since I’m using nginx.

dataforte
  • 11
  • 3
  • Also, this is cross-posted at: https://wordpress.org/support/topic/wordpress-multisite-subdirectory-errors-500-too-many-redirects-404-etc/ – dataforte Jun 16 '20 at 23:43
  • My problem is similar to this one, except I'm using nginx, therefore I'm not using .htaccess. The nginx code presented as a solution in that thread is already implemented in my nginx.conf. (https://stackoverflow.com/questions/28518723/wordpress-multisite-subsite-wp-admin-err-too-many-redirects) – dataforte Jun 17 '20 at 01:07

0 Answers0