Apache: Wordpress over local network

后端 未结 1 402
再見小時候
再見小時候 2020-12-22 03:49

I have an Apache webserver on a Ubuntu VM from which I want to run a Wordpress intranet site that can only be accessed from the internal network. The site works fine from lo

相关标签:
1条回答
  • 2020-12-22 04:28

    In your wp-config.php, set the following constants:

    define('WP_SITEURL', 'http://192.168.1.93/wordpress');
    define('WP_HOME', 'http://192.168.1.93/wordpress');
    

    When you serve your wordpress site from your local computer, all theme related files are probably served from localhost or 127.0.0.1, which are addresses which always point to "the local computer". So, when you access the website from another computer, it tries to fetch the CSS files and images from the other computer and not from the serving one.

    By setting the before mentioned constants, you force Wordpress to serve the files from the given IP address.

    Please remember to remove those constants from the wp-config.php file when you deploy your website to an actual server.

    0 讨论(0)
提交回复
热议问题