1

How do I do a href to port?

I have tried:

 <li><a href=":8123">Earth</a></li>

This resulst in directing me to localhost/:8123 I want to be directed to localhost:8123

This works, but not for the local enviorment:

<li><a href="wwww.nordicreservation.com:8123">Earth</a></li>

Don't want to just use the second one because I find it rather hard to search for errors if I can not use the local computer to test the site.

Ragatokk
  • 163
  • 1
  • 11
  • 1
    Possible duplicate of [Relative URL to a different port number in a hyperlink?](http://stackoverflow.com/questions/6016120/relative-url-to-a-different-port-number-in-a-hyperlink) – Alex McMillan Apr 03 '16 at 00:54
  • why not use the 2nd one? –  Apr 03 '16 at 00:56
  • You'll need `http://` in front of an absolute link – Panda Apr 03 '16 at 00:57
  • That does not seem right, because whenver I access the site remotely this works:
  • Earth
  • I just need it to work on a local level too, since :8123 manages to add a / in front of the : – Ragatokk Apr 03 '16 at 00:58
  • just add `$_SERVER['HTTP_HOST']` or `$_SERVER['SERVER_NAME']` to the url before the port. check they dont have the port already –  Apr 03 '16 at 00:59
  • Dagon, please write the whole string I am suposed to use... I wrote:
  • Earth
  • This directed me to: http://localhost/nordicreservation/$_SERVER['HTTP_HOST']:8123 – Ragatokk Apr 03 '16 at 01:05