how to get truly relative links?

  •  04-01-2010, 6:53 PM

    how to get truly relative links?

    If I use relative URLs and a baseHref, the full baseHref should be stripped out of links. For example if I set:
     
    editor.BaseHref = http://www.mysite.com/myfolder/
     
    Then I expect my relative image and link paths to have all that stripped out...that is, to be converted from
     
    http://www.mysite.com/myfolder/image.jpg
     
    to
     
    image.jpg
     
    Which would be a true relative link. Instead, I get
     
    /mysitefolder/image.jpg
     
    Which is not relative to my baseHref, but to the site's root folder. Which is obviously why you call this "SiteRelative" rather than "Relative". (Which makes me wonder what the point is of the BaseHref variable since you're disregarding it.)
     
    While "SiteRelative" is s probably the best in most situations, it doesn't work for environments where CuteEditor is used under a domain and directory structure that differs from where the HTML it outputs will be used. Example:
     
    CuteEditor is used here:
    mysite.com/myfolder/admin/editor.asp
     
    Output code is used here:
    mysubdomain.mysite.com
     
    which points to 
    mysite.com/myfolder/
     
    See the issue? All the links that CuteEditor outputs will have /myfolder/ in them, even though there is no such folder on the subdomain.
     
    I suggest that besides "SiteRelative", you add a "Relative" option that  will create links that are truly relative to the baseHref.
View Complete Thread