Wordpress on localhost working, when sharing IP to connect receive err_connection_refused on .js and .css files

wordpress.stackexchange https://wordpress.stackexchange.com/questions/361245

Domanda

What I have: as title suggests I set up a WordPress installation on my local machine and can run it and visit it (Mac + MAMP) over localhost:8888/myBlog. It works fine. By sharing my IP I am able to reach the WordPress blog from another computer (myIP:8888/myBlog). But here is the problem.

The problem: the page loads, but not the .js, nor the .css. By inspecting the console I see six ERR_CONNECTION_REFUSED for js and css files coming from wp-content (.css and .js of a theme I installed) and from wp-includes (again .css and .js files).

What I tried: I thought it was a problem of permission so I changed the main folder and all the files recursively with chmod -R 575 as suggested somewhere but the problem persists.

Thanks!

È stato utile?

Soluzione

As discussed in comments, the problem was that the site address was set to localhost:8888/myBlog. This is the URL WordPress is expecting your clients to be using, and uses this to generate fully-qualified URLs for scripts and CSS etc. Hence your other clients were trying to load scripts and CSS from their own localhost.

The fix is to set the correct URL, http://myIP:8888/myBlog, as the 'WordPress Address' and 'Site Address' under Settings, General.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top