admin管理员组文章数量:1302869
I've installed a Wordpress site on my local Apache Ubuntu 18.04 server with a fixed IP 192.168.100.150
.
The website is working fine locally (localhost/wordpress
), but when I try to open the site from another device (192.168.100.150/wordpress
), it automatically redirects me to 127.0.0.1/wordpress
and I get a "127.0.0.1/wordpress
" refused to host message.
What is wrong?
I've installed a Wordpress site on my local Apache Ubuntu 18.04 server with a fixed IP 192.168.100.150
.
The website is working fine locally (localhost/wordpress
), but when I try to open the site from another device (192.168.100.150/wordpress
), it automatically redirects me to 127.0.0.1/wordpress
and I get a "127.0.0.1/wordpress
" refused to host message.
What is wrong?
Share Improve this question asked Jul 17, 2018 at 20:25 rico_et22rico_et22 191 gold badge1 silver badge4 bronze badges7 Answers
Reset to default 3Maybe 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 127.0.0.1
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":
You can add the config below to wp-config
define('WP_HOME','http://example');
define('WP_SITEURL','http://example');
Or update the value in database at wp_options table. The settings of url located at siteurl and home in column option_name
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.
chrome://settings/?search=clear+browsing+data
this can be changed only on seetings---general- change the local ip adress (URL) 127.0.0.1 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;
本文标签: redirectWordpress redirecting to 127001 when accessing the site from a remote device
版权声明:本文标题:redirect - Wordpress redirecting to 127.0.0.1 when accessing the site from a remote device 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741717334a2394190.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论