: Wordpress redirects to ipaddress I have a self hosted wordpress website hosted on Digital Ocean,setup as a subdomian; ubuntu server running apache. I am trying to setup a development server to
I have a self hosted wordpress website hosted on Digital Ocean,setup as a subdomian; ubuntu server running apache. I am trying to setup a development server to test out plugin changes and wordpress upgrades. I want the data to mirror the main site. To do this I dumped the wordpress database using mysqldump. On the test server I imported this, also duplicating the wp database username and credentials.
Now, for some reason, when I go to the test url address, the wordpress site redirects the url to the test server ip address. There other people who have had this issue; and I have tried these suggested solutions:
Update the site url in the wp-admin. I can access wp-admin, but the fields to do this update are greyed out
remove OR having the statically defined WordPress Address (URL) and Site Address (URL) in the wp-config. I tried both ways, nonthing.
Update the database directly with the new url. I used codepen.io/EightArmsHQ/full/nzEjI
Clear browser cache and user a private browsing tab.
If I do a fresh install of wordpress on the server, it does not redirect
I also, verified there is no dns record issue, because, I replaced the site with a simple 'hello world' index.php, and the test url stays. As for apache, I defined this in a sites-enabled file:
<VirtualHost *:80>
ServerName test.mymainwebsite.com
DocumentRoot /var/www
</VirtualHost>
I am opened to suggestions from the community on how you setup your test servers. Maybe I'm just going about this the wrong way. I still would like input on why this could be happening.
More posts by @Karen161
1 Comments
Sorted by latest first Latest Oldest Best
Try adding this code to your wp-config.php file:
define( 'WP_SITEURL', 'http://example.com' );
define( 'WP_HOME', 'http://example.com' );
It will override any values in database. Also, check if siteurl and home keys in wp_options table are correctly set.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.