Accessing internal wordpress site from the web

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

Topic static-website Wordpress

Category Web


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.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.