SharePoint does a great Content Management job of controlling links in .ASPX, JS, HTML, TXT and whatever files.

We are now bit by this proces I think.

We reveive .MHT files (Microsofts old stuff the whole webpage in one text file approach) from Cognos and distribute those in a Document Library. (yes, we have enabled the blocked filetype .MHT in Central Admin)

Those files run fine when opened from the file-system.

Problem is SharePoint takes hold of all relative links in that .MHT file, sticks the server domain on it AND rewrites the file





So the layout is messed up when SharePoint serves the file, and, since SharePoint has altered the files, a downloaded copy is messed up also.

  • What timer job does this SharePoint magic?
  • Can it be disabled for only the .MHT file type?
  • I don't believe it is a timer job, but something more internal like an event receiver or something. Can Cognos save the information in another format like XPS or PDF and send it to SharePoint that way? – Eric Alexander Dec 17 '15 at 15:23
  • I'm sure Cognos can, but would require more (all them external files) work. In a controlled enviroment MHT is powerfull. Its them BI heads using Cognos who now blame SharePoint (rightly so)... – Danny '365CSI' Engelman Dec 17 '15 at 15:46

On a site with Publishing enabled SP takes all URLs under control,

When they link to the SP environment they are converted to Relative URLs.

This method allows for renaming (changing the URL) of pages.. and SP will change all references for you.

This also applies to URLs in the Quicklaunch and inside CEWP and Script files

Absolute URLs are not affected.

  • Workaround for Absolute URLs (to your own environment) you do not want to be converted to Relative URLs:
    • Paste the URL in an external URLs shortener like bit.ly and use the shortened URL in your SharePoint page,code,menu
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.