Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect loop logging into site #85

Open
mundschenk-at opened this issue Feb 4, 2017 · 12 comments
Open

Redirect loop logging into site #85

mundschenk-at opened this issue Feb 4, 2017 · 12 comments

Comments

@mundschenk-at
Copy link

I just tried to upgrade from the MU Domain Mapping plugin to Mercator. While the primary site of the network works fine, trying to log into another site triggers a redirect loop, never leaving the login screen.

@RavanH
Copy link

RavanH commented Apr 17, 2017

Hi, I am facing the same issue (previously using MU Domain Mapping and now seeing this infinite redirect loop) on a multisite/multinetwork installation. The weird thing is that this redirect loop is not occurring on all sites. Other sites show me logged in just fine without issues.

What I also notice is that the Mercator SSO snippet is not there in the source of the sites that have no issues, only on those that throw me into the infinite redirect.

So: 1. the redirect is caused by the sso script and 2. apparently this script is not always inserted into the source. Why?

A third weird thing: I cannot log out on any of the sub-sites.

Is this related to the COOKIE_DOMAIN constant?

@weskoop
Copy link

weskoop commented May 16, 2017

I also have all three of these issues.

@dcavins
Copy link

dcavins commented May 23, 2017

I was having problems with redirect loops, too, but it was a settings problem for me.

At /wp-admin/network/sites.php, set the site URL to the WP network URL, like site1.main-domain.org if you're using subdomains. Then in the site's settings "aliases" tab, set the URL to the mapped URL you want to use, like mapped-domain.org. The problem I was having is that I had set the main URL to the mapped URL rather than the subdomain URL.

The downside of this is that it means you can access the site using either URL, which isn't ideal for my setup, but at least the login redirection loop problem is solved.

@mrjarbenne
Copy link

There was some work being done by @roborourke to split our Mercator into discreet modules, one of which looked to be managing redirects to help to identify a primary domain, but I'm not sure what state those repos are in, or the process to migrate.

https://github.com/humanmade/Mercator-GUI
https://github.com/humanmade/Mercator-Redirect
https://github.com/humanmade/Mercator-SSO

@roborourke
Copy link
Contributor

roborourke commented May 24, 2017 via email

@mrjarbenne
Copy link

That would be amazing. Thanks for that.

@njbarrett
Copy link

I'm currently having this issue also.
We have 2 sites in a network with completely different domains (not subdomains).
Let's call them a.com and b.com.
a.com is the main site in the network. Logging into this site is fine.
If you are logged into a.com and then try and visit b.com you get stuck in a redirect loop.
SSO is enabled.
When not logged into a.com, and you try to login to b.com, it won't let you login, it just keeps returning to the login page for b.com

@mundschenk-at
Copy link
Author

@roborourke Anything we can do to help?

@gbissland
Copy link

Just had the same issue, fixed it with @dcavins comment above. I changed the site url in Info tab to the sub-dir url and just had the new domain url under alias. Had to updates the home/site url again, but no loop now and all good.

@mikelking
Copy link

mikelking commented Jan 30, 2020

Currently attempting to run on WordPress 5.3.2 and when Mercator is active if I am already logged in I can access the CMS which is good. The plugin solves the wp-ajax issues caused by cross site scripting with a CDN (origin-pull configuration via Amazon CloutFront) but once I log out and am no longer able to login back into ANY of the sites in the MultiSite cluster.

I have looked at solutions offered =>

#48

&&

#41

There are some suggestions about changing the root site and mapping it back as an alias but that will not work as this cluster is hosted on WP Engine and it is not possible to remove the root domain as ALL of their systems are based off of account.wpengine.com when you opt for MultiSite.

Anyone have any suggestions?

@splaquet
Copy link

splaquet commented Apr 2, 2020

i actually just ran into this as well. i have 3 multisites running WooCommerce for a client. all 3 currently have identical setups. the only real difference is the plugins that had been installed/removed on the first site, before i spun up the new ones.

WPMU domain mapping was on that first site.

i have Mercator on all 3 sites now, and it's only the first site that's causing issues. the biggest issue that i've had on the first site is with WooCommerce... when customers put items into their shopping carts, and then view their carts, the items aren't displaying in their carts and the carts are showing as empty.

the only solution that i've found is to completely remove any aliases/mapped domains from the ones on the first site (that originally had them), and make sure that the custom domain is completely replacing all references to the original domain throughout the database.

@roborourke
Copy link
Contributor

@splaquet sorry, that's annoying regarding the behaviour with woocommerce especially. I've been finding it hard to get time to work on this at the moment but I haven't forgotten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants