devUrl and Proxy url not working, using sage 9 on xampp environment

Hi am trying to setup my website using sage. On config .json i have

"publicPath": "/wp-content/themes/mytheme",

“devUrl”: “http://mysite.local”,
“proxyUrl”: “http://localhost:3000”,
“cacheBusting”: “[name]_[hash:8]”,
“watch”: [
“app//*.php",
"config/
/.php",
"resources/views/**/
.php”
]
}

I am not able to access the website using any of the above Urls. I am running xampp on a linux environment please assist. @mmirus

Hey @Samuel_Kahara,

What’s the URL you have configured with xampp? Can you successfully load the site at that URL when using Sage or using something like Twenty Nineteen?

Hi @mmirus thanks for the response. I have configured this url http://localhost/mysite and it successfully loads with sage.

Okay! What this part of config.json does is tell Browsersync to run on the proxyUrl http://localhost:3000/ when you run the command yarn start, and then forward requests to http://localhost:3000 to your local development URL (devUrl) and return the response to the browser.

Since http://localhost/mysite is where your local development server is hosting your site, that’s the value to which you should set devUrl. Update that in your config.json, and then run yarn start from inside your theme’s folder. (Run just yarn first if you haven’t yet, to install the necessary dependencies.)

Once yarn start is running, try opening up http://localhost:3000 in your browser, and hopefully it will be working!

@mmirus i want to use http://mysite.local as the devUrl but it doesnt load anything after setting it up on config.json.
http://localhost/mysite however works when set as devUrl

Setting the devUrl doesn’t control what URL your site is hosted at–Sage can’t control that. It just tells Browsersync where the site already exists.

If you want to change the local dev URL that your site is hosted at, you’ll need to modify your XAMPP configuration.

@mmirus your idea of modifying the xampp config worked. thanks alot.

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.