Migration failed badly - Redirect loop error (server)

  • Posted June 18, 2014

Hi guys,

I followed this guide in migrating WordPress ( and everything went okay UNTIL the last part.

After changing DNS and IP, I keep receiving error server redirect loop error. I tested with various browser and even clear cache, but still doesn’t work.

I am using www by the way.

I’m out of ideas on where this problem lies. Do you mind to share your thoughts?

Using Unbuntu 14.04 & LAMP.



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

For starters, I found this: <pre> curl -vvv

GET / HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/ zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Host: Accept: /

< HTTP/1.1 301 Moved Permanently < Date: Wed, 18 Jun 2014 15:55:54 GMT < Server: Apache/2.4.7 (Ubuntu) < X-Powered-By: PHP/5.5.9-1ubuntu4 < X-Pingback: < Location: < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 <

** server can’t find NXDOMAIN </pre> It looks like when you set up DNS, you forgot to add the www CNAME to point to

Now, when I curl it and force the server, here’s what I get: <pre> curl -H “host:”

<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href=“”>here</a>.</p> <hr> <address>Apache/2.4.7 (Ubuntu) Server at Port 80</address> </pre> Now, this tells me that your server is saying “I’m You’re wanting” Then the browser tries to go to, and it says “I’m You’re wanting…” ad infintum.

Edit /etc/sites-enabled/(WHATEVER CONFIG YOU’RE USING) and add this line after <VirtualHost *:80> or <VirtualHost default:80>: <pre> ServerName Server Alias </pre> save the file, and run this: <pre> service apache2 reload </pre>

The domain I told you to contact me at. It’s Jon at that domain. shoot me an e-mail.

easy solution: <pre> tail -20 /var/log/apache2/ </pre> It will tell you what’s wrong.

Here’s a vhost config for you:

You can replace the ones you have with this one.

Replace all that with this (remove any spaces before > and after < ): <pre> ServerName ServerAlias DocumentRoot /var/www/ <Directory / > AllowOverride All </Directory> </pre>

When you say “guys”, I’m assuming you mean DO guys. I’m a customer, but this might help:

are you familar with the database? If so, you might want to check if in the wp_options (or SOMETHING_options) table you don’t have the siteurl set to the old IP: <pre> select * from wp_options where option_name=‘siteurl’

±----------±------------±-------------------------±---------+ | option_id | option_name | option_value | autoload | ±----------±------------±-------------------------±---------+ | 1 | siteurl | http://YOUR_DOMAIN | yes | ±----------±------------±-------------------------±---------+ </pre> if it has an IP rather than a domain, run this: <pre> UPDATE wp_options SET option_value=‘http://YOUR_DOMAIN’ WHERE option_name=‘siteurl’; </pre> change YOUR_DOMAIN to your actual domain, of course.

Also, you might want to make sure you ported over the .htaccess file. If you did, you will need to make sure AllowOverride is set to ALL in the Apache config.