Cannot get ngrok to serve up my WordPress site
Asked Answered
M

6

5

I have a simple wordpress install using Mamp Free Version on OS/X.

Version 2.0.19/2.0.19
Web Interface h#tp#//127.0.0.1:4040
Forwarding h#tp#//6c219c8e.ngrok.io -> localhost:8888 Forwarding
h#tps#//6c219c8e.ngrok.io -> localhost:8888
Connections ttl opn rt1 rt5 p50
p90
1 0 0.00 0.00 6.00 6.00

For some reason when I try the links generated by ngrok, the website loads forever, then I get

Page not available.

Merrileemerrili answered 17/7, 2015 at 4:57 Comment(2)
make sure you website is running at localhost:8888 and firewall is not blocking that port.Retouch
I checked, I don't have a firewall running on my laptop, and I checked the port to confirm it was 8888 in MAMP.Merrileemerrili
P
11

As @Magico stated, download from the repo https://github.com/jonathanbardo/WP-Ngrok-Local and place that in your plugins directory, activate the plugin.

Then, after you get your ngrok tunnel URL up & running, take that URL and place it in your wp-config.php as follows:

define( 'WP_SITEURL', 'http://example.ngrok.io/' );
define( 'WP_HOME', 'http://example.ngrok.io/' );

Now you will be able to access the homepage as well as the admin dashboard.

Pastoralist answered 10/8, 2018 at 0:31 Comment(3)
Doing this actually results in a redirection loop and apparently doesn´t work for me.Jaguarundi
Instructions are here ngrok.com/docs#wordpress Need to use relative URLs.Shallot
Updated link to instructions here: ngrok.com/docs/using-ngrok-with#wordpressDisquietude
T
5

According to the faq:

You need to add one of the following plugins to force Wordpress to issue relative URLs.

Sorry I don't have enough reputation points to post the rest of links.

Teakwood answered 18/7, 2015 at 7:13 Comment(0)
C
4

You can start ngrock setting your virtual host and your port with this command:

ngrok http -host-header=dev.yoursite 8080

and then install and activate only one of these plugin to navigate with relative urls

https://github.com/jonathanbardo/WP-Ngrok-Local (i'm using this one)

https://github.com/optimizamx/odt-relative-urls

http://wordpress.org/plugins/relative-url/

http://wordpress.org/plugins/root-relative-urls/

full article and documentation here https://ngrok.com/faq#virtual-hosts

Cotsen answered 3/1, 2017 at 7:59 Comment(0)
D
1

I'm not having luck with this approach. I'm using a plugin called "Relative URL" but only the homepage is rendering on my end. Other pages in the site do not show up. The site is running locally as localhost:8888 which is the path I set temporarily in the SETTINGS>GENERAL SETTINGS and I noticed with the Relative URL plugin running it's still trying to throw the :8888 on the end of the ngrok URL. Just don't know what to do about it currently.

Delacruz answered 17/9, 2015 at 21:7 Comment(1)
I have same problemCrista
A
1

The Relative URL plugin in wordpress got my site loading correctly remotely through ngrok.

Allveta answered 8/1, 2016 at 18:28 Comment(0)
C
0

For someone who is still having an issue with ngrok on wordpress , you can follow these steps:

  1. After running ngrok copy the link and edit siteurl and home column in wp_options table

  2. Go on administration panel and then edit your menus by adding ngrok_url generated.

Cene answered 7/3, 2018 at 17:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.