static website - Accessing internal wordpress site from the web

admin2025-06-01  3

My webserver(WordPress) is running Apache on localhost port 80 with dedicated public IP. On the Firewall I have configured a SNAT rule:

HTTP policy - (From Anyone on the web) > (using public IP) > (send traffic to Internal IP)).

I can confirm SNAT works to an extend. I can access the wordpress page through the public IP. However, the site doesn't load properly. CSS and images are gone and the whole layout is decremented:

When trying to /wp-admin, the external user sees "localhost/xxx" and connection is lost.

Image 1 and 2

Just to mention, my site runs Apache24 with phpmyadmin, php7.4, MySQL and WordPress 5.4.

If any info is needed let me know.

Edit: phpmyadmin is accessible and I can login without any problems. This must indicate that the issue is a wordpress configuration. Nevertheless, I hope someone can help :-)

Image: phpmyadmin access via public IP

My webserver(WordPress) is running Apache on localhost port 80 with dedicated public IP. On the Firewall I have configured a SNAT rule:

HTTP policy - (From Anyone on the web) > (using public IP) > (send traffic to Internal IP)).

I can confirm SNAT works to an extend. I can access the wordpress page through the public IP. However, the site doesn't load properly. CSS and images are gone and the whole layout is decremented:

When trying to /wp-admin, the external user sees "localhost/xxx" and connection is lost.

Image 1 and 2

Just to mention, my site runs Apache24 with phpmyadmin, php7.4, MySQL and WordPress 5.4.

If any info is needed let me know.

Edit: phpmyadmin is accessible and I can login without any problems. This must indicate that the issue is a wordpress configuration. Nevertheless, I hope someone can help :-)

Image: phpmyadmin access via public IP

Share Improve this question edited May 1, 2020 at 15:02 Deffjm asked May 1, 2020 at 14:23 DeffjmDeffjm 13 bronze badges 4
  • Can you re-upload your images using the built in image uploader rather than pasteboard? They're not loading – Tom J Nowell Commented May 1, 2020 at 14:43
  • I've uploaded the images on imgur. They work now :) – Deffjm Commented May 1, 2020 at 15:03
  • Check to see if your site_url and/or home settings set to localhost. If they are, try changing them to use your dedicated IP address instead. – Pat J Commented May 1, 2020 at 15:54
  • That wouldn't work. The whole problem is, even if you manage to access the front page of yourd WordPress, the moment you click something a new path is created. For example localhost/xxx or publicIP/xxx. This (in my case) will result in connection loss. Anyway I answered my own question. The trick was very simple but unfortunately I was too naive to follow other peoples "way-of-doing-things" – Deffjm Commented May 1, 2020 at 17:42
Add a comment  | 

1 Answer 1

Reset to default 0

So I managed to fix it by changing both SiteURL and homeURL to being the exact same. Now I've finally added an A-record in my DNS so the sites uses its own URL. Works like a charm :)

Im not sure why but I've seen others place "http://..." for SiteURL and "http://www..." for homeURL. However, this wouldn't work in my case even. Hope it can help other who face the same problem.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748747582a313734.html

最新回复(0)