Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Media Library items are missing "www" in the url of the image View modes: 
User avatar
Member
Member
ndeych-gmail - 1/28/2010 4:00:30 PM
   
Media Library items are missing "www" in the url of the image
Currently, the files are upload into the media library are missing the "www" in the url. I need the files to have that. Is this a setting somewhere?

Thanks

User avatar
Member
Member
john-wakefly - 1/29/2010 2:17:31 PM
   
RE:Media Library items are missing "www" in the url of the image
I was able to fix this with a code change to one of the core Kentico controls.

On line 2162 of the \CMSModules\MediaLibrary\Controls\MediaLibrary\FileList\FileList.ascx.cs code, I changed this:

fileUrl = UrlHelper.GetApplicationUrl(si.DomainName) + fileUrl.TrimStart('~');

to this:

fileUrl = UrlHelper.GetApplicationUrl() + fileUrl.TrimStart('~');

The original code uses the site domain name stored in the system, which has no "www" (and it can't be added). The new code uses the HttpContext (within the Helper method) to get the domain, and any subdomain.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/1/2010 6:06:21 AM
   
RE:Media Library items are missing "www" in the url of the image
Hi,

Which version of CMS are you using? I assume it is 5.0 since it is in the 5.x version forums. It is already possible to add domain name with "www" to site domain name in Site Manager -> Sites and also, in 4.1 version there was one hotfix which fixed this issue. So there is no need to change any code, just add domain name with "www" to the site settings.

Best Regards,
Juraj Ondrus