My domain "walterscube.com" is point to a google cloud wordpress server http://xx.xx.xx.xx/ . I use godaddy as my domain provider.
I changed my site address and wordpress address from ip to domain, because i want to see my domain name in the browser not my ip. The webpage will be in an infinite redirect lope between the ip and my domain. Can someone help what possibly causes this?
I already tried change all IP to domain in the database, and i tried add to wp-config.php this lines
define('WP_HOME','http://walterscube.com/');
define('WP_SITEURL','http://walterscube.com/');
,with no result.
Thank you
Vince
*edit: The server is the default google cloud launcher>WordPress, I did not change any settings. apache2.conf:
Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
wordpress.conf:
<VirtualHost *:80>
ServerAdmin xxx@xxx
DocumentRoot /var/www/html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Try running these queries in your DB to update your site's URL in the database. I would think that the constants you reference above should do it, but for thoroughness' sake, update these values, too.
UPDATE wp_options SET option_value = REPLACE (option_value,'http://xx.xxx.xxx.xx','http://walterscube.com');
UPDATE wp_posts SET guid = REPLACE (guid,'http://xx.xxx.xxx.xx','http://walterscube.com');
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://xx.xxx.xxx.xx', 'http://walterscube.com');
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value,'http://xx.xxx.xxx.xx','http://walterscube.com');
The reason I reccommend this over checking your DNS records or anything else is that when I curl -H 'Host: walterscube.com' xx.xxx.xxx.xx -v
, I get
* TCP_NODELAY set
* ...
> GET / HTTP/1.1
> Host: walterscube.com
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Mon, 26 Mar 2018 13:10:29 GMT
< Server: Apache/2.4.10 (Debian)
< X-Powered-By: PHP/5.6.33-0+deb8u1
< Location: http://xx.xxx.xxx.xx/
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
(Which tells me that it's WordPress doing the redirecting, not the web server.)
Edit: ^ Quite an assumption, it turns out. The above likely just means that PHP's being executed by Apache. Not necessarily that WP's sent a 301 response!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.