file:// rewrite

Topics: Developer Forum, Project Management Forum, User Forum
Nov 16, 2009 at 10:35 AM

Hi There

Great product, very powerful, I have read the doco, but can't locate whether the following can be done in IIS6.0

Original HTML Embedded URL - file://g:/folder/file.doc

Rewrite URL - https://www.domain.com/g/folder/file.doc

Can it also only do it for a known source IP or set, as in everything external to the local network

I have a need to get an intranet available on the externally where its not really feasible fixing up the internal mess.

Thanks in advance

 

Dean

Coordinator
Nov 16, 2009 at 3:24 PM

Nope -

IIRF does not dynamically rewrite HTML. 

the embedded link like file://g:/folder/file.doc  is stuffed into an HTML document.  IIRF never looks inside the HTML that is sent back-and-forth, and does not modify it.  If you have a server-side script that is generating that URL, you gotta change the server-side script.

The way IIRF works is to intercept incoming requests from a client (browser) to a server.  So IIRF is able to intercept a request for http://server/folder/file1.doc and dynamically rewrite it to http://server/folder/file2.doc , (and so on).  But that rewriting happens on the server side, and is only possible because the client (browser) has asked for a particular document from the IIS server.  In the case of a file:// URL, the client (browser) does not send any HTTP request to the server.  The client just tries to open the named file directly.  Once the file:// URL is sent down to the client, IIRF is not and cannot be involved in the "transaction" whereby the client retrieves and opens the file.

> Can it also only do it for a known source IP or set,

yes, IIRF can perform rewrites for a known set of IP addresses.  You would use a RewriteCond, and check the REMOTE_ADDR server variable.