IIS 5 & IIS 6
ISAPI Filter creating 301 redirect for web dav
Last post May 10, 2009 05:42 PM by SimonKing
Apr 27, 2009 07:02 AM|SimonKing|LINK
I need to add an ISAPI filter which allows for WebDav requests to either be redirected or the Url to be modified. We have a site that currently has urls similar to:
http://site.domain.com/sitename/ this is a WSS 2.0 site. We are moving to WSS 3.0 and are moving the sites in the hierachy to allow for a better distribution of sites across databases and therefore an improved
backup and restore strategy.
The new url would be
http://site.domain.com/sites/sitename/ I have written an ISAPI filter that modifies the url from the one above to the new url to allow for existing links to be carried forward without users getting a broken
link. In addition to the above users can get to the new site with new urls such as
The old domain is only being maintained to allow for existing links in documents, favourites, etc, to continue to work.
The big headache I have is that users will have created network places with a unc style path for webdav requests. Therefore I need to be able to handle those requests such as
\\site.domain.com\sitename\document_library\ with the sites path inserted into the request.
Running my ISAPI filter in debug I can see the request coming in and it gets modified to include the sites/ path but the code returns a failed request. There is clearly more to it than that but very little available if you search for it. If I allow the
"/" path to fall through my filter without modification then the full new unc path works but the oldone doesn't.
If needs be the users will have to remap their network places but if I can spend a couple of days on this and provide a resolution I would be much happier.
Any help would be much appreciated.
May 10, 2009 05:42 PM|SimonKing|LINK
I have managed to work this one out, if the request is for a url of just / then allow the request to fall through as there is a site at / it will deal with the inital requests which may have a method of options or search. WebDave sends that request first
before interrogating the actual folder so when the folder is included in the url we can prefix it with the sitename bit of the url and then WSS is happy.