prefixing url with ~

Topics: General, Visual editor
Jun 15, 2011 at 3:23 PM

Have have inserted one image in the html editor.

Select an image from media libery, and save the content. The image tag is inserted correctly.

<img src="/Renderers/ShowMedia.ashx?id=24cb244a-0d9e-4034-bdd4-2a5127fc9ea2" />

But when I edit the content, and save it again, then it have set an ~ in the beginning of the url. Now the editor do not show the picture any more. Is there a setting for disabling this or ?

<img src="~/Renderers/ShowMedia.ashx?id=24cb244a-0d9e-4034-bdd4-2a5127fc9ea2" />

Jun 15, 2011 at 9:34 PM

The ~/ based URL's is something Composite C1 enforce - the aim is to enable sites to run both as the root application (only application) on a website or in a sub folder. This also allows a site to be moved from one to the other, without links breaking. At runtime ~/ based links are typically substituted with the correct path and the image reference should work just fine.

Are you experiencing a concrete problem with the ~/ URL's or did you just find them odd?

Jun 16, 2011 at 3:15 PM

Yes I have some problems with this.

When I open the editor after saving, then it will not render the picture, becouse of the ~.

If I go to source, removes the ~ then the picture is perfectly shown in editor.

It is confusing for the user, as they dont think the picture is there any more. 

Jun 17, 2011 at 6:41 AM
Edited Jun 17, 2011 at 6:42 AM

Hi neess,

I would like to reproduce what you are experiencing with images in the editor and figure out what is going on :)

Could you please give me a few more details?

  1. What is the version/build of your Composite C1? (On the menu, click Help > About Composite C1, copy Build No.)
  2. Do you insert an image in Visual or Source mode of the XHTML editor?
  3. Do you edit content in Visual or Source mode of the XHTML editor?

I tried this on the latest release ( v 2.1.1, Build 2.1.4113.99):


  1. Inserted an image in Visual mode --> It appears OK.
  2. Switched to Source mode > the tag is with "~" <img src="~/Renderers/ShowMedia.ashx?id={GUID}" />--> This is OK.
  3. Edited content and saved in Source mode + Edited content and saved in Visual mode --> The tag remains unchanged.


  1. In Source mode, added an empty tag <img src="" />
  2. In Source mode: Insert > Image URL > (image from the Library) --> the URL is added without the "~"

But from here, if you:

  • preview the page, the image is displayed
  • switch to Visual (the image is displayed here) and back to Source, the URL gets the initial "~"

In both cases (no "~" and with ~~"), the image is displayed both in the Visual mode and in the Preview.
If the Image URL is not with "~", the system enforces it for the reasons mawtex described above.

Thank you in advance.


Jun 24, 2011 at 5:58 AM


I'm running version 2.1 beta 4

It is an object I have created, where the string uses the editor widget.

I insert the image in visual mode, and do not edit the other content

Jun 24, 2011 at 6:16 AM
neess wrote:

I'm running version 2.1 beta 4

 I would recommend using (upgrading to) the latest official release of C1: v. 2.1.1 (Build No. 2.1.4113.99)

There might have been some problems like this on earlier versions, especially on "betas", this was certainly fixed on 2.1.1