0

I have a self-hosted WordPress (windows 2016 and IIS).

I have my domain hosted on namecheap and all DNS settings are made. It's correct redirecting to my IP.

However, my internal links appear the IP and not the domain.

I researched and to change this I saw that I have to change WP_SITEURL and WP_HOME.

My original setting (IP fake)

WP_SITEURL http://112.123.123.123:8085
WP_HOME http://112.123.123.123:8085

From the above everything works (but I get the IP on the internal links)

WP_SITEURL http://autocoaching.life
WP_HOME http://112.123.123.123:8085

In the above way the site loads with the broken CSS and still in the links appear IP

WP_SITEURL http://autocoaching.life
WP_HOME http://autocoaching.life

That way nothing works, what appears is the iis welcome site and not my site

I've tried everything, I'm grateful for any help!

1 Answer 1

1

Your config in WP is generally correct, but you have "forwarding" enabled at Namecheap, where they just redirect to your IP. Set it up as a real DNS A entry pointing to the IP.

Then set up your IIS to listen at port 80.

For reference, here's how I debugged it (I'll replace your actual IP with the example you used):

curl -v "http://autocoaching.life/"
* Hostname was NOT found in DNS cache
*   Trying 192.64.119.185...
* Connected to autocoaching.life (192.64.119.185) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: autocoaching.life
> Accept: */*
> 
< HTTP/1.1 302 Found
* Server nginx is not blacklisted
< Server: nginx
< Date: Fri, 26 Jan 2018 21:53:51 GMT
< Content-Type: text/html; charset=utf-8
< Content-Length: 49
< Connection: keep-alive
< Location: http://112.123.123.123:8085/
< X-Served-By: Namecheap URL Forward
< 
<a href='http://112.123.123.123:8085/'>Found</a>.

http://112.123.123.123:8085/ redirects to http://112.123.123.123/, and that lead to the dreaded IIS page.

However, curl -v -H "Host: autocoaching.life" "http://167.114.6.216:8085" looks much better and gets us the correct WP response, therefore your IIS is set up correctly as far as the host name goes, but it's listening on the non-standard port and because of the namecheap redirect, it doesn't get the request with the correct Host header (which I've added with curl).

Once you fix your DNS entries from HTTP forwarding to a normal A entry and make IIS use Port 80 for that host, you should be fine.

If for some reason, you don't want to use port 80, that's fine too, but you'd have to set up WP to reflect that in the URL, e.g. use http://autocoaching.life:8085 and type that into the URL as well.

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.