As far as I understand, you are retrieving some content with Kentico API and URLs are not resolved (specifically '~') for you since the Kentico output filter does not apply in MVC (which is responsible for this operation).
Our recommendation is not to change the way how CKEditor works, but change the way how you resolve the HTML code in your MVC application. In case you would like to resolve URLs programmatically, I would recommend to utilize HTMLHelper.ResolveUrls() method (Kentico 8.x).
Here is an example on how you can use this specific method:
string originalHTML = "";
string resolvedHTML = HTMLHelper.ResolveUrls(originalHTML, SystemContext.ApplicationPath);