Hi guys,
I followed this guide in migrating WordPress (https://www.digitalocean.com/community/tutorials/how-to-migrate-wordpress-from-shared-hosting-to-a-cloud-server-with-zero-downtime) 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.
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Replace all that with this (remove any spaces before > and after < ): <pre> ServerName yourdomain.com ServerAlias www.yourdomain.com 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.
For starters, I found this: <pre> curl reginaldchan.net -vvv
GET / HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Host: reginaldchan.net 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: http://www.reginaldchan.net/xmlrpc.php < Location: http://www.reginaldchan.net/ < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 <
** server can’t find www.reginaldchan.net: NXDOMAIN </pre> It looks like when you set up DNS, you forgot to add the www CNAME to point to reginaldchan.net
Now, when I curl it and force the server, here’s what I get: <pre> curl -H “host: www.reginaldchan.net” 162.243.47.213/
<!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=“http://www.reginaldchan.net/”>here</a>.</p> <hr> <address>Apache/2.4.7 (Ubuntu) Server at www.reginaldchan.net Port 80</address> </pre> Now, this tells me that your server is saying “I’m reginaldchan.net. You’re wanting www.reginaldchan.net.” Then the browser tries to go to www.reginaldchan.net, and it says “I’m reginaldchan.net. You’re wanting www.reginaldchan.net…” ad infintum.
Edit /etc/sites-enabled/(WHATEVER CONFIG YOU’RE USING) and add this line after <VirtualHost *:80> or <VirtualHost default:80>: <pre> ServerName reginaldchan.net Server Alias www.reginaldchan.net </pre> save the file, and run this: <pre> service apache2 reload </pre>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.