$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>static website - Accessing internal wordpress site from the web|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

static website - Accessing internal wordpress site from the web

matteradmin9PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far