SharePoint: Adding hyperlinks to document libraries

Sometimes you have external content that you would like to make available from your document library without uploading a file. Examples include documents in other SharePoint sites or libraries, and even links to other web pages including SharePoint pages and external web sites.

Turns out SharePoint already has this built-in, just well hidden. There is a built-in Content Type called "Link to a Document". Just add this to your library and then just click the "New" dropdown and select "Link to a Document"! It will simply ask you for a document name and url. You can supply a URL to anything that starts with "http://", including both SharePoint documents and external web pages. It does not support a link to a network share such as "\\myfileserver\folder1\somedoc.doc".

  1. Display your library (Example: Shared Documents)
  2. Click Settings and Library Settings
  3. Click Advanced Settings
  4. Check "Allow management of content types" and then OK
  5. In the Settings page scroll down to Content Types and click "Add from existing site content types"
  6. Select "Link to a Document", click Add and then Click OK
  7. Go back to your library and click the New dropdown and select "Link to a Document"
  8. Enter a display name (Document Name) and the URL (must start with http://) and click OK
So how does it work? The Content Type has a template that is an ASPX page that contains a server side control named SharePoint:UrlRedirector. When this page is rendered it simply redirects to the address listed in the items URL property. Also experiment with adding these built-in content types to your library:
  • Basic Page
  • Web Part Page
  • Dublin Core Columns (Do a web or wikipedia.com search for "Dublin Core")
  • Picture

You can also add customized folders to the New dropdown. See here. Need to add custom columns / meta data to any of the above? Just create a new Content Type based on one of the above and add it to your library. See here.



Tony said...

Solved my quandary perfectly! Thank you!

Anonymous said...

Hi, thanks for the post, is it possible to access the metadata using the link that we have added by using this process.

Mike Smith said...


Not by using this option. But I think you could write one to do so. (something to put on my todo list!)


Anonymous said...

Yes, you can have a link with metadata, but you have to ditch the predefined option and create one yourself.

Here is where I got the info to add metadata to Links to Documents: http://www.toddklindt.com/blog/Lists/Comments/ViewComment.aspx?ID=226

Anonymous said...

Thank you thank you! been wondering about this for ages.

Jesse Palmer said...

Wow. I fumbled around Microsoft's "help" pages for about 15 minutes before I went back to Google to search again. Up popped your post and it showed me exactly what I needed to do. Thanks!

Anonymous said...

Thanks Mike, works a treat. It also allows you to link to other folders!

Anonymous said...

I do not have the "settings" option on my menu. Just "new", "upload", "actions" options.

Do I need different authority from my admin area?


Mike Smith said...

> I do not have the "settings" option on my menu. Just "new", "upload", "actions" options.

You have "Member/Contributor" permissions. You will need "Designer" or "Owner/Full Control" permissions to see Settings.


Rajni said...

Perfect !!! Thanks for this post and it worked well for my requirement.

Josh said...

Finally!! Thanks for the information. Just what I have been looking for.

Anonymous said...

My problem is that the documents are on a media server where the link does not start with http. Is there a way to link to a file that starts with mms://?

Mike Smith said...

> Is there a way to link to a file that starts with mms://?


1) use notepad to create a text file named redirect.htm (or any name you choose that ends with .htm)

2) In this file add this little JavaScript routine


window.location.href = window.location.search.substring(1);


3) upload this file to a library in SharePoint and note the URL (something like http://yourserver/sites/yoursite/shared documents/redirect.htm)

4) When you add a new Link to Document enter the URL this way:

http://yourserver/sites/yoursite/shared documents/redirect.htm?mms://pathtoyourdocument


Anonymous said...

Thanks! I will try that

Sam Varghese said...

Perfect.. exactly what I wanted. Thanks.

TheGoat said...

Hi Mike, yet another SharePoint newby you have solved a problem for (site deserves to be top of Google etc)

Is it possible to get links in document libraries to open in a new window?

Mike Smith said...


> Is it possible to get links in document libraries to open in a new window?

Yes. It would be a variation of this article:


I'll see if I can put together a new article to add "Open in new window" to a document library.


Anonymous said...

Does the above "adding hyperlinks" function only work with the non-free version of sharepoint?

Mike Smith said...


Yes it is in both WSS and MOSS and in Foundation 2010 and Server 2010.


Anonymous said...

Mike -- You're the best. Thanks for the post.

Anonymous said...

Thank you for the post. Quick question. I do not have a multimedia server, just a data server. Is there a way to link documents that are stored locally: //myserver/folder/doc.doc

Mike Smith said...


Link to a Document will only work with URLs that start with http:// or https://

You could create a web page using notepad and save it with an ASPX extension (mydocument.aspx) to a SharePoint library. The page would only have the following content:

<a href="#" onClick="history.go(-1)">Return to the library</a>


You would need to create one of these files for each document you want to link to.


Anonymous said...


That's what I figured. I will look into your solution. Thank you again. Cheers!

Anonymous said...

Hi Mike,

I get a message that says "The specified item or folder name is too long. The URL path for all items and folders must be 260 characters or less (and no more than 128 characters for any single item or folder name in the URL). Please type a shorter item or folder name."

I copied/pasted the link to the site where my other reports are located...is there a way to shorten the link and still get to the same webpage?

Anonymous said...

Excellent clear instructions. Answered my question perfectly.


Mark said...

Nice post!

I was wondering though if you can use this same option but then having the document opening in Edit mode.

Any ideas?


Mike Smith said...


I'm working on an article on how do duplicate all of the menu links, and I may have found a way to do what you want, but it will be a week or so before I can document and post that. Check back...


Anonymous said...

Great post, but be aware the redirect code doesn't appear to work in FireFox, i.e.

window.location.href = window.location.search.substring(1);

CH said...

This does not work for me it opens an excel spreadsheet, any suggestions?

I have tried inserting the link at the top of the spreadsheet where it asks for a URL and a name and it does show up in the properties?

Mike Smith said...


You added the Content Type to the library, added a New Link to a document, entered the URL to your Excel file in another library or site and then clicked the link?

What did you want it to open if not the Excel file? (I may not be understanding your question...)


Nick said...

Wondering if there is any way to make these links to documents/folders work in Windows Explorer? I get an .aspx webform file there instead of a useable link. Would love to have my links work in explorer as well...

Mike Smith said...


No way I know of. A library stores files, and the Link to a document feature creates an ASPX file that includes redirect code. So all that is seen by Windows Explorer is the ASPX file.


Anonymous said...

Awesome. Thanks for the help.

Stacie said...


I use SharePoint 2007 and am trying to create links to documents elsewhere on the site, I.E from one document library to another. The only option I get though is to link the document library - not the actual document itself. Is it possible to do this, or can I only link the library?

Thank you,

Mike Smith said...


Just go to the document library and right-click the document you want to link to, click Properties, and copy the complete URL. Paste this URL into the new Link To A Document item.


manasa said...

Hello All,
you can link your server file's also using edit properties option. there u have to change http to file. example File://J:\Hello\hello.xlsx

F. Hilman said...

Hi, I have a document library with several folders in side. When I try to create a link in one of those folders in the library, it is created or referenced in all the folders. is there a way to just have the link in one folder instead on all to folders?

Mike Smith said...

F. Hilman,

> When I try to create a link in one of those folders in the library, it is created or referenced in all the folders.

"Link to a Document" is just an ASPX file that is added to the library or a folder within the library. I can't think of any way it would show up in another folder.


Anonymous said...

I would like to add a web part which shows the graphics of the URL site on sharepoint without actually re-directing to the site. Is this possible?

Mike Smith said...


> without actually re-directing to the site

If you just want a web part to display an image or a page, use a Page Viewer web part or use a Content Editor Web Part and add the HTML for an IFRAME.

Or do you want to click a link in a document library to display the image?

Anonymous said...

Is there any way to to file the link with column headings created on the page? It doesn't give me an option and then the link doesn't group in the grouping settings I have set up for the page.

Mike Smith said...


You can add meta data columns to the Link to a File item. Link to a File is a Content Type, so you can make a copy of it and add columns.

Go to your top level site.
Go to Site Actions, Site Settings, Content Types.
Find the Link to a File content type, copy it and add the columns needed.

Anonymous said...

I am unable to open .aspx files in a doc lib post migration to SP 2010.All the other files are coming up fine like word, excel, pdf.

Only a blank page opens up when clicked on the .aspx file

Mike Smith said...

> I am unable to open .aspx files

No error at all? Is there anything in the SharePoint or Windows event logs?

What happens when you create a new Page or Web Part Page in 2010?

Did the pages use a custom master page when in 2007?

You may want to post your question here: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010setup/threads


Stephanie said...

Thanks so much Mike! Your instructions are very clear and helpful. I've been wondering how to do this for months and thrilled to find out how finally!

Gregory Davis said...

I have sharepoint foundations 2010 installed on windows home server 2011. How can I access the whs 2011shared folders in sharepoint foundations? Do i have to build a hyperlink to every document in the share?


Mike Smith said...


I have not used WHS so I have no idea! :-)

Try posting your question in the TechNet forums for WHS or SharePoint 2010.


Anonymous said...

Hi Mike - If a person is using Safari to access an Intranet site (SharePoint 2007, MOSS), what is the syntax to enable Safari to open an Excel file (located on a network share)? In SharePoint I have tried the following link File://ServerName/FilePath/filename.extension. In Internet Explorer this path works fine when opening the Excel file but the Excel file does not open when clicking the link from Safari. Any help you could give would be greatly appreciated. - Jodi

Mike Smith said...

I don't use Safari, so I can't test one way or the other. In any case I don't think SP 2007 is very friendly with non-IE browsers. SP 2010 and 2013 are much better across browsers.

Did you try using http?


Anonymous said...

This tutorial was so helpful. I struggled to solve this problem for quite some time via MS help. THANK YOU!!!

Rick said...

I created a link to another site on my server. I used the (Click here to test) and it worked perfectly. However, when I click the link from my library it takes me to a blank site. That according the bread crumbs is a blank site under my library. Any ideas?

Anonymous said...

Thank for your tips, but when I click click new link, it always prompt upload document windows. Please help

Dan Lussier said...

Hi Mike.

Great explanation. Simple and to the point.

Follow up question for you - If I have added the Basic Page content type to my Document Library, how do I go about modifying the appearance of the Basic Page template? I'd like to have some formatting such as the Quick Launch bar on the left side and the Text Layout button on the ribbon.

Any advice?

Kipper Bush said...

I know this was not an option enabled by default for me.

This blog post show how to do better than I can explain.


Tim said...

This works great and allows us to create a central library of important stuff. Thanks for the info.

Paula said...

Hi Mike,
Thank you for being so well versed on this feature. I am looking for a variation to this solution. I would like the new item list to link to a document where the location is a fixed network address (so the users don't need to know the path-it is already provided). Essentially the template for a file is located elsewhere and I don't want it duplicated in this library. I tried to add the .ASPX file as the template however it opens my default web editor (SharePoint Designer) when selected. Any suggestions?

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.