This is a discussion on HTTP redirects within the Windows Web Servers forums, part of the Web Server and Related Forums category; Greetings. Can anyone tell me how to implement HTTP redirects on a Microsoft web server? I have recently taken over ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Greetings.
Can anyone tell me how to implement HTTP redirects on a Microsoft web server? I have recently taken over maintenance of a Microsoft-hosted site and the server clearly doesn't support Apache-style .htaccess files. The hosting company tech support is practically useless; they didn't seem to know what an HTTP redirect was and didn't understand why a JavaScript redirect wouldn't suffice. They eventually pointed us to a web page which told us to replace each individual file to be redirected with something like the following: <%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location", "http://www.nothingisreal.com/" %> However, this seems to work only if the file's extension is `.asp'. As our files have a variety of extensions and content types (`.html', `.htm', `.txt', `.pdf', `.jpg', `.gif', etc.), this solution is clearly inadequate. Regards, Tristan -- _ _V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited / |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard (7_\\ http://www.nothingisreal.com/ >< To finish what you |
|
|||
|
Tristan Miller wrote:
> Can anyone tell me how to implement HTTP redirects on a Microsoft web > server? I have recently taken over maintenance of a Microsoft-hosted site > and the server clearly doesn't support Apache-style .htaccess files. The > hosting company tech support is practically useless; they didn't seem to > know what an HTTP redirect was and didn't understand why a JavaScript > redirect wouldn't suffice. They eventually pointed us to a web page which > told us to replace each individual file to be redirected with something > like the following: > > <%@ Language=VBScript %> > <% > Response.Status="301 Moved Permanently" > Response.AddHeader "Location", "http://www.nothingisreal.com/" > %> > > However, this seems to work only if the file's extension is `.asp'. As our > files have a variety of extensions and content types (`.html', `.htm', > `.txt', `.pdf', `.jpg', `.gif', etc.), this solution is clearly > inadequate. IIS has support for doing this kind of thing directly from IIS Manager. Open up the Properties page on the web site you want to redirect (or a subfolder if you just want to redirect part of the site). Look for the "Home Directory" tab (or "Directory" or "Virtual Directory" on subfolders). From that tab you can switch it from "A directory on this computer" to "A Redirection to a URL". That should do what you want. -- Jim Patterson Ottawa, Ont CANADA |