Hi experts! I'm implementing a URL shortener like bit.ly. For this, I have a Java servlet backend which does a response.redirect(targetURL)
for every redirection request.
This works fine for HTTP requests, but I'm having a problem with file://
protocols. The problematic case is this:
- The target is a directory (such as
file:///N:/somefolder
whereN:
is a network drive) - The client browser is IE
For Firefox, this works fine, the directory listing is shown in the browser as if I'd typed 'file:///n:/somefolder
' in the address bar (and I have my server added to Firefox's list of trusted URIs)
For IE, if I type 'file:///n:/somefolder
' into a browser and hit Enter, it opens a NEW explorer window. This is the exact behavior I want when I do a server side redirection, but this simply doesn't work. I get the "IE Cannot open..." error.
Is this not possible? Or is there some setting akin to the Firefox preferences that add my server to a list of "trusted" URLs for the redirection to happen?
Note that if the target is a file, such as 'file:///n:/somefolder/test.doc'
this works fine, even in IE!
Thanks in advance!