programing

Wordpress 다중 사이트:서브사이트 wp-admin "err_too_many_redirects"

minimums 2023. 3. 9. 21:56
반응형

Wordpress 다중 사이트:서브사이트 wp-admin "err_too_many_redirects"

새로운 WordPress 4.1 멀티사이트를 설치했습니다.

전면을 열고 메인 사이트 대시보드에 액세스할 수 있습니다.

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

서브사이트를생성했는데서브사이트대시보드에접속할수없습니다.

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

다음 오류가 발생하였습니다.Codigo de 오류: ERR_TOO_MANY_REDIRECTS

--

전방에 접속할 수 있다

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

그러나 스타일이 없으면 css URL이 올바르지 않습니다(페이지를 찾을 수 없습니다).

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

--

다음과 같은 값이 있습니다.

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

--

BBDD(wp_blogs 테이블)

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);

--

정답을 못 찾겠어요.내가 뭘 잘못하고 있지?

정말 감사해요.

파블로

(해당 솔루션에 대해서는 책임을 지지 않습니다.);

그래도 문제가 해결되지 않으면 .htaccess를 사용하여 해결하십시오.

WP 네트워크 설치로 지정된 .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).*) featured/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ featured/$2 [L]
RewriteRule . index.php [L]

이를 위해:

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]

당신과 비슷한 문제로 내 문제도 해결됩니다.

원래 솔루션이 여기에 게시되었습니다.링크

내 경우엔 Nginx를 사용했는데

즉, .htaccess는 동작하지 않습니다.아파치이기 때문입니다.

Nginx 를 사용하고 있는 경우는, WordPress Codex 의 Nginx 페이지를 참조해 주세요.https://codex.wordpress.org/Nginx

어떤 이유로든 Codex가 오프라인으로 전환될 경우를 대비해 가장 중요한 부분을 여기에 붙여 둡니다.

WordPress 다중 사이트 하위 디렉터리 규칙

# 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 다중 사이트 하위 도메인 규칙

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
}

주의: WordPress Network 설치는 더 이상 필요 없습니다.blogs.dir단, 오래된 설치를 이행할 때는 규칙이 필요할 수도 있습니다.

Cloudflare를 사용하여 SSL 모드를 플렉시블에서 풀로 변경하는 경우 다음과 같이 하십시오.

여기에 이미지 설명 입력

이건 나한테 효과가 있었어.

출처 : https://wordpress.org/support/topic/wp-multisite-too-many-redirects-on-wp-admin/

여러 사이트 WordPress가 있으므로 다음 행을 제거해야 합니다.

define('DOMAIN_CURRENT_SITE', 'blog.urlcorrect.com');

define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

부터wp-config.php.

나에게 가장 중요한 것은 데이터베이스를 확인하는 것이었다.

테이블을 찾다wp_options행을 변경합니다.option_name siteurl그리고.home부터http://127.0.0.1/something로.http://localhost/something

도움이 되길 바래!

제 경우엔 엔긴스도 쓰고 있었는데...

WordPress Codex 문서를 따르지 않고 CloudPanel 문서를 따라 했습니다.WordPress용으로 서버를 셋업 할 때 "www"는 포함하지 말아주세요."www."를 추가한 다음 하위 도메인을 기반으로 WordPress 네트워크를 만들어야 하는 경우 "err_too_many_redirects" 오류를 일으키는 루프가 발생합니다.

만약 너무 늦었다면, 제가 한 수법은 다음과 같습니다.

  1. 데이터베이스의 모든 링크(플러그인을 통한 링크 또는 phpMyadmin의 SQL 사용)를 "www.example.com"에서 "example.com"(사이트 URL 포함)로 변경합니다.
  2. 서버 컨피규레이션파일에서 이 부분을 삭제합니다(또는 코멘트합니다만, 이 부분은 선두에 있습니다).CloudPanel을 사용하는 경우 Domains/your domain/Vhost:
#server {
#  listen 80;
#  listen [::]:80;
#  listen 443 ssl http2;
#  listen [::]:443 ssl http2;
#  {{ssl_certificate_key}}
#  {{ssl_certificate}}
#  server_name example.com;
#  return 301 https://www.example.com$request_uri;
#}

이러한 변경을 적용하기 전에 데이터베이스 및 필요한 모든 것을 백업해야 합니다.

언급URL : https://stackoverflow.com/questions/28518723/wordpress-multisite-subsite-wp-admin-err-too-many-redirects

반응형