Sunday, September 18, 2022
HomeWordPress DevelopmentFind out how to simply make Wordpress & WooCommerce work with ngrok

Find out how to simply make WordPress & WooCommerce work with ngrok


Ngrok is a brilliant helpful CLI instrument which allows you to expose your localhost HTTP servers to an internet-facing HTTPS endpoint, at no cost!
You will get it right here: https://ngrok.com/.

I have been struggling to discover a good, brief tutorial on the best way to make it work correctly with my native WooCommerce retailer, so hopefully you’ll discover this beneficial:



1. Set up the ‘Relative URL’ plugin

First off, guarantee that your WordPress web site points relative URLs by putting in this plugin: Relative URL.



2. Make WP serve itself through your tunneled hostname

Add the next strains on the finish of your wp-config.php file:

outline('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
outline('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
Enter fullscreen mode

Exit fullscreen mode



3. Instruct ngrok to rewrite the host header

Add --host-header=rewrite to your ngrok command.
For instance:

ngrok http --host-header=rewrite http://localhost:8080
Enter fullscreen mode

Exit fullscreen mode

Accomplished 🎉

P.S: If you happen to’re a WooCommerce retailer proprietor and wish to simply sync it along with your Google Sheets, check-out our fast information on the best way to do it.


Initially posted right here.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments