Roots Discourse

Strange Login Issue

I am reasonably new to roots bedrock but have noticed a strange login issue that seems to affect every site that I use roots bedrock on.

When I visit a URL like this:
https://mysite.com/wp-admin/

I am redirected to the login page but can never login.

If I visit a URL like this:
https://mysite.com/wp/wp-admin/

I then have no problems logging in.

Since using roots bedrock on a few production sites I have had a few complaints from users about being unable to login which I think is related to the issue I have above (not 100% sure though). It is a little bit difficult to explain to clients the workaround and I myself don’t understand why the second link works but the first one doesn’t.

I am hoping to find a solution for this so that I can permanently rule it out as a potential reason that other users can’t login. Does anyone have any ideas what is happening?

1 Like

Perhaps I want to do something like suggested in this thread:

Or maybe redirect it to a page not found.

If you visit settings > permalinks you shouldn’t even need to save it that should set up the redirect

If that fails just save them and it should work

No, saving permalinks doesn’t solve the problem. At the moment I have the htaccess directives as part of the apache config. So maybe I need to move them into htaccess.

In what way are you never able to login? Do you see an error when you attempt to? Does the page never load? Etc.

The page looks like it submit but then just returns to the login form.

Know one else has any ideas?

Am I the only one experiencing this issue?

I have weird issues sometimes too, for example clicking stuff does not do anything, just refreshes the same site. Happened most times on login page (for example it log-ins the 3rd time i try, but not the first), and now I Have similar issue with search page. If I would have to guess I’d say its related to config.json and webpack serving your local assets. Check devUrl, publicPath and proxyUrl I guess.

I had a similar issue on my multisite setup and needed to add the following lines, not sure if you’re dealing with multisite but this may be worth trying too. The cookie_domain one in particular is what I needed.

/**
 * Multisite Cookies - Prevents redirect loop on wp-login
 */
Config::define( 'ADMIN_COOKIE_PATH', '/' );
Config::define( 'COOKIEPATH', '' );
Config::define( 'SITECOOKIEPATH', '' );
Config::define( 'COOKIE_DOMAIN', '' );
1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.