acore-cms icon indicating copy to clipboard operation
acore-cms copied to clipboard

Redirect to localhost

Open Hawolex opened this issue 11 months ago • 5 comments

New docker comppose installl on Ubuntu 24.04 all containers starts good.

Image

when i try to enter server ip i get redirect to localhost. docker compose loggs show:

php-1 | 172.18.0.5 - 14/Feb/2025:20:45:09 +0000 "GET /index.php" 302 php-1 | 172.18.0.5 - 14/Feb/2025:20:45:10 +0000 "GET /index.php" 302 php-1 | 127.0.0.1 - 14/Feb/2025:20:45:13 +0000 "- " 200 php-1 | 127.0.0.1 - 14/Feb/2025:20:45:18 +0000 "- " 200 php-1 | 127.0.0.1 - 14/Feb/2025:20:45:23 +0000 "- " 200 php-1 | 127.0.0.1 - 14/Feb/2025:20:45:28 +0000 "- " 200 The .env.docker have changes variable DOCKER_WORDPRESS_URL=http://192.168.80.206 even tried with url pointed at host

Where to start now?

Hawolex avatar Feb 14 '25 20:02 Hawolex

Would have been nice with some help here. can`t for the heck figure out why all attempt to connect redirect to localhost in browser.

Hawolex avatar Feb 18 '25 16:02 Hawolex

Now i even tried to put the url in the .env.docker befor building the img again. but docker logs still only output:

php-1 | 127.0.0.1 - 18/Feb/2025:17:57:56 +0000 "- " 200

Hawolex avatar Feb 18 '25 17:02 Hawolex

I have the same issue like yours, have you solved it now?

marsOfChina avatar Sep 17 '25 09:09 marsOfChina

I have the same issue like yours, have you solved it now?

I have sadly abandoned the project for having this running.

Hawolex avatar Sep 17 '25 16:09 Hawolex

simply do this:

sudo docker-compose exec wp-db mysql -uwordpress -pwordpress wordpress UPDATE wp_options SET option_value='http://yourdomain/ip' WHERE option_name='siteurl'; UPDATE wp_options SET option_value='http://yourdomain/ip' WHERE option_name='home'; UPDATE wp_site SET domain='yourdomain/ip'; UPDATE wp_blogs SET domain='yourdomain/ip' WHERE blog_id=1; UPDATE wp_sitemeta SET meta_value='http://yourdomain/ip' WHERE meta_key='siteurl'; EXIT;

then also to be sure sudo docker-compose exec php bash find /var/www/html -name wp-config.php Once you find it, search inside the domain settings home / site url and set there your domain :) that is all or you can just add in begining of config file this 2 lines: define('WP_HOME','http://yourdns/ip'); define('WP_SITEURL','http://yourdns/ip');

matol89 avatar Sep 24 '25 14:09 matol89