0

I don't have a very good understand on ports so I'm not sure how to explain this.

I have an app on my site running on, for example, www.url.com:1234

I need the url to be like www.url.com/class/subfoler/index.html

How do I do that? Thanks.

Buddy
  • 10,874
  • 5
  • 41
  • 58
Lim Jia Wei
  • 61
  • 2
  • 10

2 Answers2

0

You need to parse the port with the domain.

Try:

http://www.url.com:1234/class/subfoler/index.html
Michael Seltenreich
  • 3,013
  • 2
  • 29
  • 55
  • That's what I'm using now, so actually I'm trying to not include the port in the url so I can use relative links. But I've learned that it is impossible to do so, but thanks anyway. – Lim Jia Wei Apr 07 '17 at 01:02
  • Oh I completely missed your question! Here's how you do it on linux: http://stackoverflow.com/questions/16573668/best-practices-when-running-node-js-with-port-80-ubuntu-linode what os are you running? – Michael Seltenreich Apr 07 '17 at 05:00
-2

You can try using an iframe tag in your index.html file which would serve your app's (port 1234) URL from inside your main (port 80) website, like so:

<iframe src="http://www.url.com:1234">If you can read this, your browser does not support iframes.</iframe>

Konstantinos
  • 103
  • 5
  • The user did not ask anything about iFrames. – Michael Seltenreich Apr 06 '17 at 00:11
  • The user did not specify how this needs to be done, so perhaps an iframe will help in this occasion. Your answer above assumes that the app and the website are one and the same (which is probably incorrect). – Konstantinos Apr 06 '17 at 00:56
  • The user asked how to access www.url.com/class/subfoler/index.html on port 1234, how does you answer have anything to do with the question? – Michael Seltenreich Apr 06 '17 at 03:37
  • No, actually the user asked how to make the URL accessible from a webpage on port 80, even though it is actually running on port 1234. – Konstantinos Apr 06 '17 at 06:48
  • Thanks, I know about this workaround, but I was trying to use relative links (although now I learned that it is impossible) – Lim Jia Wei Apr 07 '17 at 01:04