• Hello,

    I have a redirection problem, causing an infinite loop (in javascript!)…

    The main website (network) is http://example.com and I work with subdomains (please forgive me, I can not show my client’s url because I will not be able to remove it after a couple of days)

    I have 1 subdomain:

    http://book.example.com

    And I use the domain http://www.book.com to hide the url “http://book.example.com”

    However, when I want to edit a post/page or update the permalink , it redirects me to wp-login.php (but with an infinite javascript loop due to this line (634) in domain_mapping.php). Note that I have this problem only on the SUB website, not on the MAIN website!

    // wordpress-mu-domain-mapping/domain_mapping.php, line 634
    $url = get_original_url( 'siteurl' );
    	if ( $url != site_url() ) {
    		$url .= "/wp-login.php";
    	echo "<script type='text/javascript'>\nwindow.location = '$url'</script>";
    	}

    The value of $url is “http://book.example.com&#8221;
    The value of site_url() is “http://www.book.com&#8221;

    So I commented the following line:

    //echo "<script type='text/javascript'>\nwindow.location = '$url'</script>";

    And it does not loop anymore. But I have to login TWICE! The first login is when I log in to wp-admin and the second login is when I want to edit a post!

    I noticed this too:

    When I am in the wp-admin of the sub website (http://book.example.com/wp-admin/), the url behind the link “Edit” (post,…) is http://www.book.com/wp-admin/post.php?post=676&action=edit, not http://book.example.com/wp-admin/post.php?post=676&action=edit. I think it is not right!

    Please, I am desesparate! Give me a little help…

    My .htacces:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    </IfModule>
    # END WordPress

    My wp-config.php

    define('WP_DEBUG', false);
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    $base = '/';
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'example.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    define('SUNRISE', 'on');
    define('WP_DEFAULT_THEME', 'booktheme');
    define('WPCF7_AUTOP', false);

    Thanks!

    https://wordpress.org/plugins/wordpress-mu-domain-mapping/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Redirection loop on wp-login.php (get_original_url() != site_url())’ is closed to new replies.