Welcome to WebmasterWorld Guest from 50.16.78.128

Forum Moderators: ocean10000

Message Too Old, No Replies

IIS 404 redirecting using a textfile

   
3:03 pm on Apr 14, 2009 (gmt 0)

5+ Year Member



Pardon my ignorance, I almost never use IIS. Basically is there an IIS equivalent to the Apache .htaccess file? I want to redirect all traffic within a folder to another URL (even when it hit's 404's). All i have found as solutions for this is done through the IIS GUI config, and I do not have access to that.

Thanks,
Ryan

4:21 pm on Apr 15, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



IIS has no such file. You will have to do this via the Administrative tools for managing IIS.
12:15 pm on Apr 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If your host is running IIS 7 and has the 'Microsoft URL Rewrite Module for IIS 7.0' installed you can define redirects in your web.config file.

eg:

[2]
<system.webServer>
<rewrite>
<rules>
<rule name="Home.htm" patternSyntax="Wildcard" stopProcessing="true">
<match url="*/mydirectory/*" />
<action type="Redirect" url="http://www.website.com/newpage.aspx" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
[/2]

* Edit: the rewrite rule above has not been tested, so it may contain errors

12:54 pm on Apr 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is some more info on the subject:
[blogs.iis.net...]