WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Redirect loop on entire network due to domain change (8 posts)

  1. oilandsugar
    Member
    Posted 1 year ago #

    I am currently working on moving a multisite install to a new server space and changing it's main domain. At this moment the files are on the server and everything was working fine while setup on the temporary address (static IP) that the hosting company gave me while my domain were moving.

    Once my domains finished moving to the new hosting provider, the only thing that was left to do was putting back the real URL in place of the IP adress in the adress bar when you'll go see the site.

    I read the article on moving multisite a couple of times before and prepared myself to edit the files and the database to make the change effective.

    I changed the domain in wp-config.php and after that searched and replaced an exported copy of my database to change the domain everywhere. I uploaded all of this back at their places and I am now stuck with a 310 error caused by a redirect loop on all of my sites and also on the wp-admin page.

    Before that i got a database connection error but I checked all the fields of my database again and "solved" it while getting the redirect loop.

    The problem most probably resides in the database change or the wp-config file configuration somewhere but I just can't figure it out on my own.

    Here is a chunk of my wp-config.php file concerning the domain

    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'http://3lectromode.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    And my .htaccess file looks like that at the moment:

    # Use PHP5 Single php.ini as default
    AddHandler application/x-httpd-php5s .php
    
    # BEGIN WordPress
    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]
    # END WordPress
    
    #Edited by emerald000
    AddType application/x-httpd-php .html
  2. So in the directions on how to move Multisite - http://codex.wordpress.org/Moving_WordPress#Moving_WordPress_Multisite - We specifically suggest using a search/replace script in order to fix any serializes data

    http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

    Did you use that?

    Also this:

    define('DOMAIN_CURRENT_SITE', 'http://3lectromode.com');

    should not have http://

    define('DOMAIN_CURRENT_SITE', '3lectromode.com');
  3. oilandsugar
    Member
    Posted 1 year ago #

    I tried with the script at first and got the same error. I changed the DOMAIN_CURRENT_SITE value and removed the http://, now I have an error establishing database connexion.

  4. When you did your replace, did you change 123.45.67.89 to 3lectromode.com or did you put the http in there as well?

  5. oilandsugar
    Member
    Posted 1 year ago #

    That's a good question, there is a possibility that I included the http:// at the same time but I'm not sure.

    Now I am thinking that I could double check with another database from another of my multisite installs to see how each URL should be formatted in the database and fix them individually. Is this an acceptable way to repair it you think?

  6. I would say it may work, and it's what I'd be trying.

  7. oilandsugar
    Member
    Posted 1 year ago #

    Good, thanks for the fast answers! I will reply back if there is other problems that arise about this issue or if this solution work :)

  8. oilandsugar
    Member
    Posted 12 months ago #

    I fixed the problem. The lines that were not correctly entered in the database were in the wp_blogs table. These should not contain any http:// or www before the domain :)

Topic Closed

This topic has been closed to new replies.

About this Topic