By ak331
I have a problem which I have not managed to find by searching. I set up my wordpress website and restored it using a backup from plugin updraft plus. I restored the old database, and now I cannot access my website. The issue is ‘The page isn’t redirecting properly’. I have tried to access it via my droplet IP address, but this keeps redirecting to the web address and the loop continues. Is there a way I can access my wordpress installation by using the IP address and prevent the redirects? I have also tried adding /wp-admin and /wp-admin.php to the end of the urls, but have had no luck. 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!
Hi
Connect to the DB using phpmyadmin or via mysql CLI and change these two rows in table wp_options:
select * from wp_options where option_name in ('siteurl','home');
+-----------+-------------+-----------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+-----------------------+----------+
| 37 | home | https://cachoid.com/blog | yes |
| 1 | siteurl | http://cachoid.com/blog | yes |
+-----------+-------------+-----------------------+----------+
Replace the domain name with your IP and that should do it.
Cheers
FYI, @unixynet is correct. You can change this with the following MySQL queries:
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
Ofcourse, change the “www.newurl” to the IP you would like to use.
Try the following steps by using the root console of your droplet.
vim /etc/apache2/sites-enabled/000-default.conf
UseCanonicalName Off
Don’t forget to turn it back on again when in production.
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.