Wordpress Multisite: Subsite wp-admin "err_too_many_redirects"

i installed the new multi-line WordPress 4.1

I can complete the front and go to the main panel of the site

http://blog.urlcorrect.com/wp-admin/ 

I created a child node and I cannot access the panel of child sites

 http://blog.urlcorrect.com/br/wp-admin/ 

I have this error: CΓ³digo de error: ERR_TOO_MANY_REDIRECTS

-

I can access Front

 http://blog.urlcorrect.com/br/ 

but without styles, the css url is incorrect (page not found):

http://blog.urlcorrect.com/br/wp-content/themes/twentyfifteen/style.css?ver=4.1

-

I have the following values:

 current blog domain: blog.urlcorrect.com current site domain: blog.urlcorrect.com current blog path: / current site path: / 

-

BBDD (wp_blogs table)

 blog_id: 1 site_id: 1 domain: blog.urlcorrect.com path: / public: 1 blog_id: 2 site_id: 1 domain: blog.urlcorrect.com path: /br/ public: 1 

-

htaccess:

 RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [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).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] 

-

wp-config.php

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

-

I can not find the right answer. What am I doing wrong?

thanks a lot

Pablo

+7
source share
4 answers

(I do not take responsibility for this decision);)

If you still have a problem with this, try the solution with .htaccess.

Modify the specified .htaccess template using WP Network installation:

 RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [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).*) featured/$2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ featured/$2 [L] RewriteRule . index.php [L] 

For this:

 RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [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).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] 

Works with my similar problem for yours.

Original solution published here link

+7
source

Since you have a multi-page WordPress site, you should remove the lines:

 define('DOMAIN_CURRENT_SITE', 'blog.urlcorrect.com'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); 

from wp-config.php .

0
source

Which helped me verify the database.

Find the wp_options table and change the lines using option_name siteurl and home from http://127.0.0.1/something to http://localhost/something

hope this helps!

0
source

In my case, I used Nginx,

This means .htaccess will not work because it is Apache.

If you use Nginx, you can read the WordPress Codex Nginx page: https://codex.wordpress.org/Nginx

I will insert the most important parts here in case the Code fails for any reason:

WordPress Multisite Subdirectory Rules

 # WordPress multisite subdirectory rules. # Designed to be included in any server {} block. map $uri $blogname{ ~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ; } map $blogname $blogid{ default -999; #Ref: http://wordpress.org/extend/plugins/nginx-helper/ #include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ; } server { server_name example.com ; root /var/www/example.com/htdocs; index index.php; location ~ ^(/[^/]+/)?files/(.+) { try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ; access_log off; log_not_found off; expires max; } #avoid php readfile() location ^~ /blogs.dir { internal; alias /var/www/example.com/htdocs/wp-content/blogs.dir ; access_log off; log_not_found off; expires max; } if (!-e $request_filename) { # Don't use '$uri' here, see https://github.com/yandex/gixy/issues/77 rewrite /wp-admin$ $scheme://$host$request_uri/ permanent; rewrite ^(/[^/]+)?(/wp-.*) $2 last; rewrite ^(/[^/]+)?(/.*\.php) $2 last; } location / { try_files $uri $uri/ /index.php?$args ; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass php; } #add some rules for static content expiry-headers here } 

WordPress Multisite Subdomain Rules

 map $http_host $blogid { default -999; #Ref: http://wordpress.org/extend/plugins/nginx-helper/ #include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ; } server { server_name example.com *.example.com ; root /var/www/example.com/htdocs; index index.php; location / { try_files $uri $uri/ /index.php?$args ; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass php; } #WPMU Files location ~ ^/files/(.*)$ { try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-files.php?file=$1 ; access_log off; log_not_found off; expires max; } #WPMU x-sendfile to avoid php readfile() location ^~ /blogs.dir { internal; alias /var/www/example.com/htdocs/wp-content/blogs.dir; access_log off; log_not_found off; expires max; } #add some rules for static content expiry-headers here } 

Note. To install the WordPress Network, you no longer need the rules of blogs.dir when creating a network, but you may need it when migrating older installations.

0
source

Source: https://habr.com/ru/post/982495/


All Articles