recently I got to manage a Wordpress blog (so I don't know of things made before) and to start doing some edits on it I did a local docker compose as sandbox. When I copied the contents (Wordpress files + mysql db), the website worked well, instead for the links that didn't redirect to the local version but to the production one. So, to make them work (as I am unable to access to administration), I replaced in wp_options table site_url and home values with the local path ( However, since I did it, the website no longer loads and finishes into a too many redirects error. Does anyone know how to fix this?

I tried also, instead of add the changes in db, to write them in the wp-config.php file (according to this) but nothing changes.

I am using Wordpress 4.9.8 in HTTP on port 33080 and the container's dockerfile is:

FROM php:5.6.35-apache-jessie

RUN docker-php-ext-install mbstring mysqli pdo pdo_mysql
RUN a2enmod rewrite
RUN echo 'log_errors = On\nerror_log = /dev/stderr' >> /usr/local/etc/php/php.ini

I am very new to Wordpress environment, so assume that if there is something I had to do and I didn't wrote it there, I didn't do it. Thanks.


I found what's wrong. Despite what written there it seems that the Wordpress I have installed doesn't like port numbers different from 80. In fact, I tried changing my docker-compose port from 33080 to 80 and it started to work fine. In db for siteurl and home I wrote only I still don't know what to do to make it works with a custom port.

1 Answer 1


Have you tried defining WP_SITEURL and WP_HOME to point to the correct URL? This "overrides" the DB settings.


If that doesn't work, the next thing to try is the RELOCATE method


  • For the first solution, I wrote before that I did it and continued with the redirects. For the second method, I added the define('RELOCATE',true); on the config file, did the login, it set the production website... Then, I forced the value in the database but again, too many redirects.
    – Ripper346
    Commented Aug 10, 2018 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.