1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / External url validation

External url validation

4 posts, 0 answered
  1. Andreas
    Andreas avatar
    49 posts
    Registered:
    29 Dec 2007
    05 Aug 2009
    Link to this post
    Hello!

    I'm having problem with is entering a link such as http://www.test.com/test.aspx#test in the external page location in Sitefinity. Its the #test part that mess up. So I'm wondering if there is a way to disable the url validation for external page locations or if there's another solution.

    Thanks in advance.

    //Andreas
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    05 Aug 2009
    Link to this post
    Hi Andreas,

    This is possible.

    You should change the regular expressions for the external pages in the following two files:
    • PagePropertiesNew.ascx
    • PagePropertiesEdit.ascx
    They are both located in Sitefinity\Admin\ControlTemplates\Pages directory.

    Please change the following expression:
    ValidationExpression="((http|https)://([\w-]+\.)+[\w-]+|~)(:\b[0-9]{1,5}\b)?(/[\w- ./?%&=]*)?" 

    to:
    ValidationExpression="((http|https)://([\w-]+\.)+[\w-]+|~)(:\b[0-9]{1,5}\b)?(/[\w- ./#?%&=]*)?" 

    There is a "#" sign added to the expression. 

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Andreas
    Andreas avatar
    49 posts
    Registered:
    29 Dec 2007
    05 Aug 2009
    Link to this post
    Thanks for the swift reply. You guys rock!

    //Andreas
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    05 Aug 2009
    Link to this post
    Hello Andreas,

    Thank you too for bringing this issue up, and for the nice words of course :)

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Register for webinar
4 posts, 0 answered