More in this section
Forums / Developing with Sitefinity / RadEditor adding domain to relative url

RadEditor adding domain to relative url

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 0 answered
  1. Kelly
    Kelly avatar
    5 posts
    30 Jul 2007
    04 Oct 2007
    Link to this post
    I'm having a recent issue with the RadEditor. It is adding the current domain to my images relative domain when saved.  For example, I am inserting something like /images/birthday.jpg. I save (I'm done) and when I review what was saved, it has been converted to a full url path like http://<dev_domain>/images/birthday.jpg. It appends the http://<dev_domain> to the relative path. I couldn't find any documentation about this. Is it a config setting?
  2. Rumen
    Rumen avatar
    26 posts
    12 Sep 2017
    05 Oct 2007
    Link to this post
    Hi Kelly,

    By default, Internet Explorer converts all relative links to absolute on the client. This behavior is due to the DOM engine of the Internet Explorer which “fills” the paths (href or src) for the objects in an editing area.

    To fix this problem RadEditor provides a link stripping mechanism based on regular expressions that strips absolute paths in Internet Explorer and fixes the problem. When the StripAbsoluteImagesPaths and ImagesPathToStrip are set to true (their default value is true) then the editor strips all domain names in the absolute images and links paths and makes them relative. That's why my suggestion is to set both properties to true and test your image paths again.

    You can read the following KB article for more information on the topic: Stripping image and anchor paths in RadEditor v5.x - v7.x.

    Best regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Richard Baugh
    Richard Baugh avatar
    201 posts
    22 Aug 2012
    22 Jan 2008
    Link to this post
    I am experiencing this same thing but mine has a little twist to it. I have some content in a shared editor that was added to a template. The problem is that the first two instances of a url, whether it is an href or a scr is getting converted from a realtive url into an absolute url. I have the config file setup with "StripAbsoluteImagesPaths" and
    "StripAbsoluteImagesPaths" set to true. I have also added in the urls in the AnchorPathToStrip and ImagesPathToStrip. The editor seems to save these correctly and when viewing the template by clicking on the preview button everything is fine. But when I view a page on the site, the first two url instances get converted.

    We noticed this on a site that had an SSL certificate installed. The content has an image with an anchor tag wrapped around it. So the href of the anchor and the scr of the image are getting converted from a relative path to an absolute path. This wouldn't be a problem if the image's src property wasn't getting converted. For a quick fix, I added two empty anchor tags with the href set to "/" so that these get converted and not the anchor or image.

    This issue is a problem in IE and Firefox.
  4. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    18 May 2013
    25 Jan 2008
    Link to this post
    Hello Richard Baugh,

    Actually, it seems that this behavior is caused by the dynamic link parser. We have just found an inconsistency when using relative paths. The bug has already been fixed and is waiting for the upcoming release.

    Our recommendation is not to use the relative paths as they are quite tricky. They are most likely to break when you move a control from one page to another. If you are using absolute paths (starting with "/") they would always resolve the URL from the application root. Thus it would always search images and other resources in one place.

    Anyway, we are sorry for the inconvenience caused because of this bug and thanks for pointing it out. Your Telerik account has been updated.

    Sincerely yours,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered