humanmade / hm-base

Standard project layout for Human Made Projects.
81 stars 18 forks source link

Login redirect bug #13

Closed mattheu closed 6 years ago

mattheu commented 11 years ago

I have an issue where I go to site.dev/wp-admin and get redirected to site.dev/wordpress/wp-admin which is great... except that reauth=1 gets appended to the url. Which causes a logout as soon as I try and log in.

We should probably be handleing this at the level that the redirect is happening - but I can't for the life of me work out where this is...

I noticed Joel was experiencing this issue too - although he had got pretty used to it and always remembered to remove the query args from the url.

mattheu commented 11 years ago

@joe - i'm assigning this to you as I don't have a number 2 on this repo - and I know you did the nginx config stuff for HM Base. No rush ;)

danielbachhuber commented 10 years ago

Bump @joehoyle

joehoyle commented 10 years ago

I think this might be happening because we have something misconfigured somewhere. I get the feeling we shouldn't need a code fix for something WordPress should support out of the box, so I am reluctant to merge this. I'll have a bash at finding what the root cause it here if we don't know that

joehoyle commented 10 years ago

So, the reason this arrises is because we support mapping wp-admin to wordpress/wp-admin rather than redirecting, because that's how multisite with WordPress in a subdir works. However, this has the side effect that /wp-admin/ works on a single install, but the single install is actually configured with the site_url at /wordpress. This means this is "expected", you can always avoid the weird redirect by going directly to wordpress/wp-admin rather than waiting for the redirect. In which case, on multisite this patch will break things as get_admin_url will return /wp-admin so an infinite redirect will happen.

@mattheu can you do a comparison also, so if ( '/wp-admin/' === $current_url && get_admin_url() !== $current_url ) or something like that?

willmot commented 10 years ago

Is this likely to be able to be fixed? It's basically affecting all our sites and is a pain.

Especially for clients who aren't going to realise how to work around it.

pdewouters commented 8 years ago

Would be nice to fix, as clients often contact us complaining that they're unable to log in. Had that a lot with Yell

roborourke commented 8 years ago

@pdewouters @mattheu see https://github.com/humanmade/Salty-WordPress/pull/132 - we have one configuration for subdomain multisite and another for subfolder, this normalises that and fixed the problem for me at least in that situation.

pdewouters commented 8 years ago

Ah yes I applied that for working on the ADoR site.

owaincuvelier commented 7 years ago

Bump!

rmccue commented 6 years ago

Closing this, please reopen if it's still relevant!