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

relative URLs

6 posts, 0 answered
  1. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    25 Sep 2009
    Link to this post
    Hi guys,

    We have encountered the following problem. It never seems to have been a problem in the past (as far as we have seen), yet now this is giving us trouble.

    If we insert a link into a news article which has a relative path, starting from the root e.g.
    <href="/some/page">link text</a> 

    somehow the href attribute is changed so that it is prefixed with the CMS server's domain. This is a problem as our CMS server is not publicly accessible, instead our front-end app hits the CMS server to retrieve the desired page, and thus such a problem will cause 404 errors for our users.

    Is there any reason as to why this would be happen. I understand that there is a problem whereby IE will pre-fix a relative path to make it absolute, but this doesn't seem to be the issue here as the same problem is observed in firefox (both viewing the page and creating an article).

    Any ideas on why this issue seems to have arisen, and what may be done to fix it?

    Thanks for any help guys,
    Nick
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Sep 2009
    Link to this post
    Hi Nick,

    Could you tell us the exact version of Sitefinity that you use. Are you entering the links manually or you use one of the built in selectors? Generally we resole the relative path and do not include the domain name.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    25 Sep 2009
    Link to this post
    Wow, speedy reply :-)

    We are using sitefinity 3.2 SP2 - yes i know we are far far far behind the latest version but until such a time when we can do sufficient testing, we cannot risk switching over to the latest version!

    The URLs are being entered manually. Even on a page which has internal anchors, this problem is occuring!

    Thanks again!
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 Sep 2009
    Link to this post
    Hi Nick,

    Can you please take a look at your templates, and check if the editor has the MakeUrlsAbsolute content filter - http://www.telerik.com/help/aspnet-ajax/contentfilters.html

    Alternatively you can create your own Content Filter which strips the full path.

    Once you deploy the web site, you can use the ReplaceTool to fix all links in your web site - http://www.sitefinity.com/support/code-library/sitefnity/tools/replacetool.aspx

    I hope this helps!

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Nick
    Nick avatar
    91 posts
    Registered:
    04 Aug 2008
    28 Sep 2009
    Link to this post
    The editor does not seem to have this ContentFilter set, however, i have as a preventative measure added the IECleanAnchors filter.

    I have done some investigation into this problem and it seems that the absolute URL is being generated when viewing the published content through the website front-end, and not when editing/inserting the content. For example, if i was on the server, opened the browser and browsed to http://localhost/some-news-article, a anchor href would be prefixed with localhost. if i then hit the server from another machine, say via it's IP address then the IP is pre-fixed to any href attributes.

    This problem is then exacerbated when you consider that we proxy calls to the CMS through our frontend web-app. This causes problems as our CMS server is not publicly accessible - thus when the proxy call is made to the CMS the page is served up with URLs to inaccessible destinations. We have the functionality to implement rewriting rules for any content returned from the CMS to our front-end app, and this offers a quick solution to the problem, but we would like to understand the problem rather than simply fix it!

    My investigations would point to the news control being the culprit of this problem, but i have yet to investigate further to confirm this.

    Any further ideas on this guys?

    Thanks,
    Nick
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    30 Sep 2009
    Link to this post
    Hi Nick,

    Thank you for the details.

    Can you please check the following: 

    1. Insert a relative link. 
    2. Go from Design to Html mode of the editor (Screenshot1). Then to Design mode again. At this point the link should not be changed. Example
    try with the following link:
    <href="~/test.aspx"test</a> 

    3. When you save the content, and then go back to edit mode the link should look like this:
    <href="/sp2/test.aspx" sfref="~/test.aspx">test</a> 
     

    where sp2 is the name of the virtual directory we are using for the application (alias). 

    Do you replicate this on your side? In my project, the full path is not added. The rewriting rules seems like a good solution, but I agree that we have to find the root of the problem.
    Please send me your Editor declaration (together with the content filters set). I will play with them and try to find why is the full path set. 

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
6 posts, 0 answered