• I was developing a multisite mydomain.dev locally on my machine. Everything works fine on my local machine. It was previously a normal site.

    The transfer to the real server:

    1.) I exported the local database.
    2.) I edited the database with sublime and with search-replace replaced all “mydomain.dev” to “mydomain.com”
    3.) I imported the sql file to the real database
    4.) I uploaded my entire file-list.
    5.) I change the wp-config.php file to the real mysql credentials on my server.
    6.) I also changed the define(‘DOMAIN_CURRENT_SITE’, ‘mydomain.com’); //was mydomain.dev

    /* Multisite */
    define('WP_ALLOW_MULTISITE', true);
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'oegs.dev');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    
    define('ADMIN_COOKIE_PATH', '/');
    define('COOKIE_DOMAIN', '');
    define('COOKIEPATH', '');
    define('SITECOOKIEPATH', '');

    7.) I also uploaded the .htaccess file to the server

    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]

    So, to sum it up. I have edited the entire .sql Database to my real domainname. I’ve edited the config.php file to the real domainname.

    On my real server the site doesn’t work. I get a redirect loop (on the homepage as well on /wp-admin).

    Why? Any ideas?

    Kind Regards, Sepp88

Viewing 8 replies - 1 through 8 (of 8 total)
  • when you “searched and replaced” did you have the trailing slash at the end of “mydomain.dev/” if so that’s your problem.

    I recommend checking the following values in your mysql database manually to confirm:

    rows: siteurl, home in: wp_options
    rows: domain in: wp_site
    row: siteurl in: wp_sitemeta
    row: home, site url in every: wp_*_options
    and make sure every
    domain in wp_blogs is your ‘newdomain.com’

    Does this documentation help you?

    Thread Starter sepp88

    (@sepp88)

    @davidsword
    Well, I of course only replaced the domain itself without trailing slash.
    And all the places you’ve mentioned are set to newdomain.com`

    I just don’t get it.

    My only other advice would be to:

    1) make sure errors are on (check php errors too for explanation/source of loop)

    2) try to isolate wordpress, remove all other variables. deactivate plugins/themes, rename folders to /themes_/ and /plugins_/, then try to get into /wp-admin/ again.

    3) look beyond the scope of wordpress – does mydomain.com/readme.html work? is there an issue with “www.” at the domain level, or something silly like that.

    Thread Starter sepp88

    (@sepp88)

    Dear @davidsword,

    thank you for your help … however I’m not sure what is causing the loop … see for yourself here … http://j.mp/1ijMq5K

    This is the real domain, I’m working on.

    yeah that’s a WWW error, you can see the URL fight between it.

    your DNS zone is insisting on either having or not having the WWW, and wordpress is trying the opposite.

    Does your database’s site url and home in wp_options have the “WWW” or not? (this will be the indicator)

    your fix will be:

    (1) edit your DNS Zone file of your domain via the your host to allow WWW as well as allowing without WWW (contact host or google if unsure how)

    (2) search an implement: “.htaccess remove www” or “.htaccess add www” to change wordpress to either having or not having the triple W’s

    Thread Starter sepp88

    (@sepp88)

    @davidsword I do not have “www” in any of my database links … 

    e.g. wp_site … http://cl.ly/VE7V
    e.g. wp_sitemeta … http://cl.ly/VCsl
    e.g. wp_options … http://cl.ly/VDAa
    e.g. wp_blogs … http://cl.ly/VDLO

    Like mentioned, it works perfect locally. I edited just the string of the url itself without www, http, or a /

    That’s why I don’t get it.

    You see my .htaccess file above. Is this correct?
    my DNS Settings look like this … http://cl.ly/VDES

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    None of those URLs work.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘WP Multisite: Redirect loop after migrating to real server’ is closed to new replies.