Issue with Custom URL reverting to standard Salesforce domain URL

I have a site with a custom url set up so that if is entered into the browser then the CNAME record for that domain redirects to the underlying Salesforce domain for my site

Some of the links on a page in my site call a JavaScript function that does either of the following:

 window.location.href = "http://" + + "/mysite/mypage?param="+param

or" + + "/mysite/mypage?param=param", "_blank");

I notice that when the window.location.href is set then when the page changes the url in the browser is simply without any parameter information. But when I use the function to open a new tab in the browser, the url set in that new tab is

I find it odd that the url would remain the custom domain with one method, but would revert to the Salesforce domain name in the other.

Is there a reason this is happening, or any way to prevent it without hard-coding the custom domain name?

I’d also be interested to know why, when the custom domain name, is showing, there are no parameters showing.

Many thanks

Leave a Reply

Your email address will not be published. Required fields are marked *