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 Loops #6

Open
gmclelland opened this issue May 8, 2014 · 5 comments
Open

Redirect Loops #6

gmclelland opened this issue May 8, 2014 · 5 comments

Comments

@gmclelland
Copy link
Contributor

Thank you for this module. I'm not sure yet what is causing it, but I just wanted to let you know that I'm seeing redirect loops on the different sites that I'm trying to use this module on.

@gmclelland
Copy link
Contributor Author

Little more information for you.. If I clear out the "Standardize my live traffic on a standard domain name." field, the redirect loops stop and everything seems to start working correctly.

Should this block of code check if the user is NOT browsing /user/login starting on line 49?

if ($live_fqdn !== '' && $live_fqdn !== $_SERVER['HTTP_HOST'] &&
          $user->uid == 0 && (arg(0) == 'user' && arg(1) == 'login')) {
        $location = 'http://' . $live_fqdn . $_SERVER['REQUEST_URI'];
        pantheon_secure_login_redirect($location, 3600);
      }

Maybe it should like: (psuedo code)
If we are browsing the live-xxxx.gotpantheon.com site as an anonymous user then redirect all those request to the real domain unless we land on live-xxxx.gotpantheon.com/user/login? This should probably check for admin/* paths as well, right?

Maybe I don't fully understand what "Standardize my live traffic on a standard domain name." does? I assumed it would redirect anybody browsing your live-xxxx.gotpantheon.com site to be redirected to your real domain that way the live-xxxx.gotpantheon.com domain doesn't get indexed by search engines? Is that correct?

@joshkoenig
Copy link
Owner

Hey Glenn,

Thanks for the report!

You're correct about the intent of the "standardize live traffic" option, but it does indeed look like there's a bug there. I'll see if I can replicate this on my personal blog.

@joshkoenig
Copy link
Owner

Ok confirmed. My logic there's is precisely backward.

This is meant to be an exception for user/login so that you can hit that on the secure but not SEO friendly domain.

I'll get a pull request together to fix this shortly.

@joshkoenig
Copy link
Owner

Should be fixed now!

@gmclelland
Copy link
Contributor Author

That looks like it did the trick. Thanks Josh

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

2 participants