Solved

How can I redirect certain URLs to other URLs that point to files hosted externally? I am using IIS on Win Server 2012

Posted on 2014-12-02
4
253 Views
Last Modified: 2014-12-07
I was asked to redirect http request for a site on our internal web server to a different location (external server that is now hosting the files that were being served by our server). I initially used HTTP Redirect and that works if the person has logon credentials for the new location.

We need to use specific urls for guest access and so I though I could use URL Rewrite but not sure how to achieve this. Essentially I would like to redirect a URL in the format remote.ourorg:port/directory/file.pdf to ourorg.sharepoint.com/rest-of-guest-url.
0
Comment
Question by:phiriz
  • 2
  • 2
4 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
Comment Utility
the first redirect goes to the other web server, so on the other webserver you would have to do a redirect back to your sharepoint server OR use absolute url's
0
 

Author Comment

by:phiriz
Comment Utility
Hi David,

Thanks for the reply. Not sure I completely understand. There is only one web server that we have control over (our web server) The place the files are being moved to is Office 365 sharepoint service which generates specific URLs for guess access. Would it be best to do away with HTTP Redirect and use the URL Rewrite with absolute URLs. One thing I did try to so was to try to match the whole current URL (not sure that this is right) and then redirect to the new URL. I am really new to Rewrites and redirects and so some guidance would help heaps.
0
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
Comment Utility
a redirect does just that it takes all requests for something and sends these requests somewhere else.
i.e. 301 redirect www.example.com www.fabricam.com all of the requests will go to www.fabricam.com from www.example.com

The URL rewriter simply takes the incoming URL and if it matches a certain pattern it converts it to a URL that the server understands (assuming your rewrite rules are correct).

i.e. http://www.example.com/powershell.aspx converts to http://www.example.com/2014/12/12/blogpost.aspx
Url rewrite rules do not rewrite the outgoing content, only the incoming URL and the address in the users address bar doesn't change.

you said that guests do not have access to the remote server since they don't have a login account.  If the reference is on the remote server which you don't have access to then pretty much you have to use absolute references. i.e.
<a href="http://mydomain.sharepoint.com/collection/abc.pdf" Abracadabra PDF" />
0
 

Author Closing Comment

by:phiriz
Comment Utility
Thanks David. I managed to get it all done. Easier than I thought it would be once I knew what needed to be done.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now