IIS Mod-Rewrite documentation
Overview Documentation    Quick overview    Rewrite directives    Support directives    Extended directives    Control center    Apache compatibility Download Purchase FAQ  
IIS Mod-Rewrite - URL rewrite tool for IIS

Compatibility with Apache mod_rewrite

IIS Mod-Rewrite's design goal is to work identically to Apache mod_rewrite. Although this target is achieved at the 100% of the maximum possible level, some features cannot be implemented because Apache and IIS have completely different design. Those unsupported features are absolutely meaningless for IIS anyway, as they are bound to special internal workings of Apache, such as look-ahead requests.

The following list shows the features, server variables, and directives that are supported (in green) or not supported (in red) by IIS Mod-Rewrite:

Features Supported Comments
Perl Compatible Regular Expressions Yes  
Server Variable expansion %{VAR_NAME} Yes  
RewriteMap expansion ${map_name:key|default} Yes  
RewriteRule backreferences $N Yes  
RewriteCond backreferences %N Yes  
Per-Server configuration Yes  
Per-Virtual Site configuration Yes  
Per-Directory configuration Yes Supported only by IIS Mod-Rewrite Pro
Override (.htaccess) configuration Yes Supported only by IIS Mod-Rewrite Pro
Rewrite directives Supported Comments
RewriteEngine Yes  
     "!" negation Yes  
     [NC] No case text comparison flag Yes  
     [OR] Or next condition flag Yes  
     "<" less than text comparison Yes  
     ">" greater than text comparison Yes  
     "=" equal to text comparison Yes  
     "-f" Is regular file Yes  
     "-d" Is directory Yes  
     "-s" Is regular file with size Yes  
     "-x" Is file with executable permissions Yes  
     "-l" Is symbolic link Yes  
     "-F" File exists, via subrequest No Look-aheads are not available on IIS
     "-U" URL exists, via subrequest No Look-aheads are not available on IIS
RewriteRule Yes  
     [NC] No case text comparison flag Yes  
     [R=code] Force redirection flag Yes  
     [G] Force URL as Gone Yes  
     [F] Force URL as Forbidden Yes  
     [N] Run ruleset from the beginning Yes  
     [S=num] Skip next num rules Yes  
     [C] Current rule is chained with next rule Yes  
     [L] This rule is the last Yes  
     [CO=name:value:domain:expire:path] Set cookie Yes  
     [QSA] Append querystring Yes  
     [NE] Do not escape URL Yes  
     [PT] Pass through to next handler Yes  
     [P] Force proxy Yes  
     [NS] Do not allow internal subrequests Yes ISAPI does not support subrequests. Therefore [NS] always allows execution of rule
     [E=var:val] Set environment variable Yes Used for locally setting variables for later retrieval using %{ENV:XXX}. IIS does not provide any API for setting environment variables for CGIs
     [T=mimetype] Force MIME-type Yes  
     [H] Force content handler Yes Available only on IIS 7
RewriteMap Yes  
     int: Internal functions
           toupper, tolower, escape, unescape
Yes  
     txt: simple text mapping Yes  
     rnd: random text mapping Yes  
     dbm: hash database mapping Yes  
     prg: program mapping Yes  
RewriteBase Yes Supported only by IIS Mod-Rewrite Pro
RewriteLog Yes  
RewriteLogLevel Yes  
RewriteOptions Yes  
RewriteLock Yes  
Support directives Supported Comments
AccessFilename Yes Supported only by IIS Mod-Rewrite Pro
AllowOverride Yes Supported only by IIS Mod-Rewrite Pro
ErrorLog Yes  
DocumentRoot Yes  
ProxyPassReverse Yes  
ProxyPassReverseCookieDomain Yes  
ProxyPassReverseCookiePath Yes  
ServerAdmin Yes  
Server variables Supported Comments
HTTP_XXXXX (HTTP headers) Yes  
REMOTE_ADDR Yes  
REMOTE_HOST Yes  
REMOTE_PORT Yes  
REMOTE_USER Yes  
REMOTE_IDENT Yes  
REQUEST_METHOD Yes  
SCRIPT_FILENAME Yes  
PATH_INFO Yes Warning: PATH_INFO on IIS may significantly differ from PATH_INFO on Apache
QUERY_STRING Yes  
AUTH_TYPE Yes  
SERVER_NAME Yes  
SERVER_ADDR Yes  
SERVER_PORT Yes  
SERVER_PROTOCOL Yes  
SERVER_SOFTWARE Yes  
API_VERSION Yes Returns the emulated Apache API version
THE_REQUEST Yes  
REQUEST_URI Yes  
REQUEST_FILENAME Yes  
HTTPS Yes  
TIME_YEAR Yes  
TIME_MON Yes  
TIME_DAY Yes  
TIME_HOUR Yes  
TIME_MIN Yes  
TIME_SEC Yes  
TIME_WDAY Yes  
TIME Yes  
DOCUMENT_ROOT Yes  
SERVER_ADMIN Yes  
IS_SUBREQ Yes ISAPI does not support subrequests. Therefore IS_SUBREQ always returns "false"
Additionally, IIS Mod-Rewrite supports all IIS specific server variables    
 
 
Download and try
IIS Mod-Rewrite
NOW!


IIS rewrite

Download IIS Mod-Rewrite

Purchase IIS Mod-Rewrite