So if I want to redirect my user somewhere else? For example:- User enters a URL for an opened online document, he/she should get redirected to a site page rather.

Edit :-

So my scenario is :- For every document in library a specific URL will be produced. If the User directly enters this URL he/she will get the document opened in online word/excel. This is where I want the user to get redirected to another specific URL(site page) rather then opening the word/excel online.

  • There are several ways to do that. But what is the condition to trigger redirect? Or you want every document (e.g. /doclib/test123.docx) redirect to page in specific pattern (e.g. /pages/test123.aspx) – Mark L Aug 5 '16 at 9:59
  • Yes I would want them to redirect to content pages, similar to the example you have shared. Only need is it works for different document URL's getting redirected to different SharePoint site pages URL's. – mohd tahir Aug 5 '16 at 10:08
  • You can add a JSLink to re-render all the doc link to page link. Then you can run powershell to apply same JSLink to all doc lib. – Mark L Aug 5 '16 at 10:13
  • Another method is insert JQuery in your site Master page to render every document library. – Mark L Aug 5 '16 at 10:14
  • Mark i am just a beginner in SharePoint, so using the first way i don't understand even how to use JSLink and powershell. Though I do get the second way a little bit but how is that possible, controlling the rendering of document libraries using JQuery in my master page? Any tutorials links about that? – mohd tahir Aug 5 '16 at 10:43

You can add a "Link to a document" content type to your document library. Click on your library setting > Advanced setting > Allow management of content type > Add from existing content type > choose Link to a Document content type.

That's it. You can refer to this article too.

| improve this answer | |
  • Actually your help is quite appreciable but this isn't the exact answer i needed. Mark just check the Edited version. – mohd tahir Aug 5 '16 at 9:50

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.