I have installed the 301 redirect with the intent of redirecting traffic from mydomain.com to www.mydomain.com. When I enter www.mydomain.com, I receive an error message that states "The domain cannot be set, as it causes a redirect loop (within 3 redirects)."

I am sure this is something simple I am overlooking and I apologize in advance for having to ask, but I have been looking through all the settings for some other place where www.mydomain.com may be set and causing the loop and I haven't been able to figure it out.

Your assistance is appreciated.

Tom

CommentFileSizeAuthor
#4 domain_301_redirect_problem.png62.07 KBAbilnet

Comments

Jboo’s picture

I'm also having this problem. Did you figure out a fix?

timhilliard’s picture

Hi guys,

I have an idea of what this might be. Can you tell me what the domain name you are using to configure the settings is and also what the domain name you are using as the 301 redirect is?

Thanks,
Tim

mathieuhelie’s picture

I don't think this loop does anything:

+  do {
+    $response = drupal_http_request($domain, array('max_redirects' => 0, 'method' => 'HEAD'));
+    if (!empty($response->redirect_url)) {
...
+    }
+    $checked++;
+    // don't check the redirect code, as it's possible there may be another redirect
+    // service in operation that does not use 301.
+  } while (!$redirect_loop && !empty($response->redirect_url) && $checked < $redirects_to_check);

It's new in version 1.1, and I profiled drupal_http_request for a redirect_url parameter, it's not there, so the loop would always fail.

Unless the redirect is being set somewhere before form validation that I missed.

Abilnet’s picture

StatusFileSize
new62.07 KB

I'm having the same problem. Everything was working fine, without errors for a long time, but I had to temporally disable the redirect. Then, a few hour later, without any changes I tried to enable the module again, I'm getting the error:

The domain cannot be set, as it causes a redirect loop (within 3 redirects).

bkno’s picture

I ran into this too when I tried this module.

jimclegg’s picture

I just installed the module and when I enable it I get the same error :
The domain cannot be set, as it causes a redirect loop (within 3 redirects).

Ivan_Dagreat’s picture

I am having the same issue with multiple domains. Is this module supposed work as a www/non-www redirect?

mohammed76’s picture

Component: User interface » Code
Category: support » bug
Status: Active » Closed (fixed)

please upgrade to 7.x-1.2 and test. this issue was solved for me.

also, make sure you didn't enable the redirect via .htaccess.