More in this section

Forums / Developing with Sitefinity / URL Redirection for Any Link Outside Domain

URL Redirection for Any Link Outside Domain

3 posts, 0 answered
  1. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    29 Feb 2008
    Link to this post
    Our client has required us to handle all links not in their domain and domain alias (two total) to go to a specific SiteFinity generated page (they change through sitefinity) which is a general disclaimer about leaving the website, then on to the requested hyperlink.

    I looked in the developer manual, this forum, and ~/web.config and could not find anything to handle this issue.

    So basically anytime a user clicks on a link outside the customers sitefinity site they need to show a disclaimer page then let them continue on to the link they clicked.

    Could you recommend the best way to handle this?


  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    29 Feb 2008
    Link to this post
    Hi Briankb,

    When a visitor clicks a link, usually the browser is going directly to the that link, without making a new request to our server. Therefore, you should use a script that is executed on the client's side to control the browser behavior.

    Using JavaScript, you could write an event handler of all clicks on <a> element, checking the href property of this <a> tag, and implement a logic which decides whether user is going to another domain or not.

    I hope you find this helpful. Let us know if we can assist you with anything else.

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. briankb
    briankb avatar
    56 posts
    Registered:
    23 Feb 2004
    29 Feb 2008
    Link to this post
    that would probably work better :-) it was late and I was not thinking 100%. Thanks for the advice.
Register for webinar
3 posts, 0 answered