Lisa
Lisa

Reputation: 2989

The page isn’t redirecting properly in Wordpress Multisite

I am migrating my wordpress multisite (http://blogs.xxx.com) to a sub-directory in a new sever(http://blogs-test.xxx.com/blogs). After run wp-admin/install.php, I am having "The page isn't redirecting properly" error in all the pages. I have done these things:

Am I missing something else? Thanks!

Upvotes: 0

Views: 9413

Answers (4)

NJENGAH
NJENGAH

Reputation: 1267

I had the same problem with my new installation and I wasted lots of time trying everything but nothing worked..

I found the solution was rather very simple. In the set up of the multisite you are supposed to replace the htaccess contents with the newly generated content.

enter image description here

If your .htaccess still has the old content for the first site in the multisite the redirects for the secondary sites will never work for obvious reasons!!

Solution is to replace completely the old htaccess content with the new one!

Upvotes: 0

3rdi
3rdi

Reputation: 485

Try this if nothing works and thank the guy in the link i give below as he has figured it out

First thing, make sure that at WordPress General settings, you have HTTPS version URL, not HTTP.

You can verify once by checking MySQL database table. If there is HTTP, you may change to HTTPS.

Or if you need very fast solution, simply define HTTPS version URL via wp-config.php

define('FORCE_SSL_ADMIN', true);
// in some setups HTTP_X_FORWARDED_PROTO might contain 
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
       $_SERVER['HTTPS']='on'; 

define('WP_HOME','https://example.com');
 define('WP_SITEURL','https://example.com');
 /* That's all, stop editing! Happy blogging. */

Then try to access, it should work. If it works, better, at last you can use Search/Replace to fix.

Also, one more thing. Make sure you don’t have vice-versa redirection in the .htaccess

#####Ref

    https://codex.wordpress.org/Changing_The_Site_URL
    https://codex.wordpress.org/Administration_Over_SSL

This is the reference link to thank this guy!

Upvotes: 1

Lisa
Lisa

Reputation: 2989

Okay, I solved the redirect loop by modifying the wp-config.php. It was about the sub directory for my site. I had to modify these two lines from

 define('DOMAIN_CURRENT_SITE', 'blogs.xxx.com/blogs' );
 define('PATH_CURRENT_SITE', '/' );

to:

 define('DOMAIN_CURRENT_SITE', 'blogs.xxx.com' );
 define('PATH_CURRENT_SITE', '/blogs' );

Not sure why, but this solved the redirect loop issue.

Upvotes: 1

Kris
Kris

Reputation: 121

Have you made the changes in the database as well?

For a quick reference, this is a list of the main tables you will need to update with your new domain name:

  • wp_options > siteurl
  • wp_options >home
  • wp_site
  • wp_sitemeta > siteurl
  • wp_blogs > domain (change this for all instances that use your old domain)
  • wp_#_options > siteurl (the “#” refers to the blog ID of additional sites in your network)
  • wp_#_options > home
  • wp_#_options > fileupload_url

Read more here: https://premium.wpmudev.org/blog/move-multisite-new-domain

Upvotes: 0

Related Questions