Manipulating localhost address


(Oliver) #1

Hello guys,

is there a way to manipulate the localhost-address in the browser-preview?
I would like to change http://127.0.0.1:12345/preview/CAFEA67F-AEBB-4275-9BC7-4F1ABCDEFC36-5044-000130BD3FF4F81E/index.html
to “www.mywebsite.org/subfolder”.

This would be a nice feature for presentations to make the web-experience more real.


#2

I just woke up. So, this information may or may not be useful.

I think what you’re trying to do is related to the “hosts” file. You could route your desired name back to the localhost. However, the port… 12345 …might be an extra step. Basically, a line would be added to that file. I’m not sure. I didn’t try it with Hype. There are lots of guides online. Just search for “Host File Mac”.

1… 2… 3… 4… 5… @Daniel or @jonathan …is that the combination of your luggage?


(Jonathan Deutsch) #3

If you’re looking for something like “www.mywebsite.org/subfolder” that’s implying it is on a remote host. In order to do this Hype would need to upload to that web server as part of the preview process, which it does not do. Instead you will need to export this yourself and upload it.

Alternatively, if your localhost goes by a different domain name, you could probably add a meta refresh tag to the head HTML (you’ll need to do some magic to make sure it doesn’t refresh when you are on the URL you want though!) that could redirect it to a different URL. This may not work; Hype has some restrictions on the requests it allows since we don’t want the preview server open to the internet.