Using C #, I'm going to personalize the page if its first page hits.
I don't care if the solution is bulletproof, because this function is purely asta and can get worse.
It should use the ASP.NET method, not JavaScript.
with
Request.UrlReferrer.Host
You can get the URL of a previous client request. But this will not work with https from external pages
I think you should use this
Url referel
This property contains the URL of the previous page, so you can check if the current request from your site is valid.