How to safely construct URL link in the Notifying message when you don't know your domain name?

StackOverflow https://stackoverflow.com/questions/22240654

  •  10-06-2023
  •  | 
  •  

Question

Here is the problem, I am building a retail site using Gwt. My system has a private in-house message box system.

When customer successfully ordered an item, my system will send a notification (including a link to let user view orders in the order page, ex: "abc.com#!order;orderID=61") to the user's private in-house message box & to the user's email.

-When sending to "the user's private in-house message box" we don't need to know the domain in advanced co the user already staying my website so the link could mist the domain part like this "#!order;orderID=61".

My question is "How to safely construct the URL link in the Notifying message when you don't know your domain name?"

Was it helpful?

Solution

You use a backslash '/' to create a relative link:

<a href="/?orderID=61">This is your order</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top