Sharepoint - How to resolve "Cannot retrieve the URL specified in the Content Link property"

For testing purposes, try putting your html file in a document library in your portal and reference it in the CEWP from there. Eg:

http://my.portal.org/Shared Documents/myfile.html

If this works, then I am guessing it is an authentication issue. Try replicating the issue in Firefox. If it is indeed an authentication issue, you will be prompted for credentials.

UPDATE:

After some digging around I found out that you can neither access content from the layouts folder nor from outside the site collection in the ContentLink property. This is a security feature implemented by Microsoft to avoid cross site scripting.

The only way to allow this is to enable Anonymous Access on the site collection. (in case of _layouts folder)

Or if you are referencing content from another site collection, you will have to enable anonymous access on it:

Enable Anonymous Access in SharePoint 2010

(Tested both options on my SP Environment)

The reason why it is working in the PageViewer Webpart is because:

From MSDN:

If the ContentLink URL points outside of the Windows SharePoint Services Web site to a site that requires authentication, then that site must be isolated. For this situation it is recommended that you use the PageViewerWebPart instead of the ContentEditorWebPart. The PageViewerWebPart renders content within an IFrame. With IFrames, security prompting occurs on the client, enabling the target user to specify a user name and password.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.contenteditorwebpart.contentlink.aspx

Another option is to use the Content Link Webpart (available on Codeplex) which is designed as a workaround for this same issue:

Content Link Web Part for SharePoint

Tags: