5

I have git cloned a site and used Backup and Migrate to bring the database over the the local host.

Working on the remote host the login works fine. Not locally. Well not anymore it worked for about an hour I'd say.

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

I've cleared all history, tried different browsers, and restarted apache a few times.

Any ideas?

EDIT:

I can install it and after installation I stay logged in for about 60 seconds after migrating the database. I'm then redirected in a loop.

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

  • I've cleared the browsers cookies and cache
  • I've cleared drupals cache
  • restarted apache
  • tried different browsers

I'm beginning to think it may have something to do with how I'm setting up the site. I'm doing it in a very round-about way I think.

  • backup database from dev site
  • git clone site and point httpd.conf and hosts file at it
  • create database with same name, user and password from settings.php file
  • install site
  • go in an enable backup and migrate
  • import database from backup

site loads. drops after 60 seconds or so with the firefox message from above. I'm not 100% sure where to start troubleshooting.

4 Answers 4

3

You could find out for sure by adding some logging code in drupal_goto() to backtrace what function fired the redirect. Then inspect why that function fired the redirect and work back from there.

Or, some more "guesswork" approaches -

  • Check you don't have $base_url set in settings.php.

  • Clear your cache tables after installing to copy (or don't back up the cache table contents).

drush cc all

  • Disable modules which might be confused by relocation - securepages, canonical_url, logintoboggan (guessing here).

drush dis securepages canonical_url logintoboggan

  • Check your variables table for (and delete) any entries with values like '%http://your.old.domain%'.

drush vget | grep your.old.domain

drush vdel some_variable_name

5
  • well that sounds right, above my ability right now though Commented May 25, 2011 at 5:40
  • @ Chris Burgess Any other ideas on the import / export method I edited above? Commented May 26, 2011 at 8:35
  • Your import method seems fine, but there are still variables which change across servers - URL, Apache rewrite config, directory paths ... Good on you for being brave enough to set up a local dev site; it makes debugging a whole lot easier. Now is the perfect time to get your hands dirty. Don't be afraid of breaking your local Drupal install, you can just unpack a fresh copy in a moment ... get stuck in! Stefan's advice to watch your local server logs while the redirect happens, and use the debug tools in your browser to watch the requests redirect, are good steps to take also. Commented May 27, 2011 at 9:10
  • Another approach might be to disable some modules which might get sore about relocation - securepages, canonical_url, logintoboggan (guessing here). You can do this in your local DB, or via Drush - Commented May 27, 2011 at 9:15
  • I feel stupid, this was all on a new virtual machine and I had not enabled a2enmod rewrite yet. with a little help from a friend it was fixed. Thanks a lot for your help. Commented May 27, 2011 at 20:38
2

sudo a2enmod rewrite fixed it. That is all.

0

You should also check your server error log and also install Firebug (if you don't have it already) and check the "Net" tab to see the HTTP requests. From these 2 sources you should normally have something to point you in the right direction.

0

Same issue happened to me, infinite redirect loop- I could see all the pages within my website but when I try to login with my credentials, it gives me this error. So, I couldn't access my site as an admin. I found some solutions like adding a module, but I can't add/disable any modules. It took me around a day to resolve this,

Following steps worked for me in resolving this error:

  1. Modified .htaccess file RewriteBase /drupal

  2. uninstalled a module Voting api module, deleted the voting api folder.

  3. cleared the cache_* tables in the database through phpmyadmin

  4. Modified my.ini/my.cnf file - max_allowed_packet = 32M.

hope it would help someone.

REF:

https://www.drupal.org/node/706986

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.