Search code examples
wordpresslocalhostweb-hostingngrok

CSS not loading with Ngrok and Wordpress


Hello I'm using Wordpress relative path plugin to access the website from my mobile device, but the website CSS is not loading properly. I tried different plugins but still the issue is there. Info:

OS: ubuntu 18.04

WP: 5.4.2

Webpage

Ngrok GET requests

My current wp-config has:

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

Solution

  • Try adding this :

    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']."/wordpress/");

    Temporary can add this http://ccd711c88dc4.ngrok.io/wordpress/ to site_url

    you can see file can access using this below URL :

    http://ccd711c88dc4.ngrok.io/wordpress/wp-includes/css/dist/block-library/style.min.css?ver=5.4.2

    Not by this :

    http://ccd711c88dc4.ngrok.io/wp-includes/css/dist/block-library/style.min.css?ver=5.4.2