I've installed a Wordpress site on my local Apache Ubuntu 18.04 server with a fixed IP

The website is working fine locally (localhost/wordpress), but when I try to open the site from another device (, it automatically redirects me to and I get a "" refused to host message.

What is wrong?

7 Answers 7


You can add the config below to wp-config


Or update the value in database at wp_options table. The settings of url located at siteurl and home in column option_name


Maybe your case was different from mine, but I want to share with you how I fixed this issue, hoping will be useful for other people.

In my case the issue was caused by All In One Wordpress Security Plugin (AIOWS), due to "IP RETRIEVAL SETTINGS" configuration.

My site is hosted on AWS, via Elastic Beanstalk environment and I have different instances under a load balancer. In this case seems the last version of this plugin is no more able to correctly detect the IP of the clients and so start blocking them by redirecting to

I fixed this issue by simply changing that configuration from "REMOTE_ADDR (Default)" to "HTTP_X_FORWARDED_FOR".

You can change this from: "WP Security" => "Settings" => "Advanced Settings": enter image description here


Well, that was a problem related to my browser's cache - opening the site in incognito mode fixed the problem.


Actually, I deleted my browser's cookies, refreshed and it worked.



this can be changed only on seetings---general- change the local ip adress (URL) by the sot IP (192.16.x.x)


If you face this kind of issue first check the .htaccess file because there may be a redirection like

RewriteEngine On 
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} (bot|crawl|robot)
RewriteCond %{HTTP_USER_AGENT} !(bing|Google|msn|MSR|Twitter|Yahoo) [NC]
RewriteRule ^/?.*$ "http\:\/\/127\.0\.0\.1" [R,L]

Then remove them or add # (comment the line) then open the private window and disable the cache and check Your Site. Then will be worked.


When using a reverse proxy, add to the nginx config:

    proxy_set_header Host $http_host; (or $host)
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Your Answer

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

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