IIS Mod-Rewrite documentation
Overview Documentation    Quick overview    Rewrite directives    Support directives       AllowOverride       AccessFilename       ErrorLog       DocumentRoot       ProxyPassReverse       ServerAdmin    Extended directives    Control center    Apache compatibility Download Purchase FAQ  
IIS Mod-Rewrite - URL rewrite tool for IIS

DocumentRoot Directive

DocumentRoot defines the value returned by server variable DOCUMENT_ROOT.

This directive is optional, and if not used, IIS Mod-Rewrite will automatically append the appropriate root directory in per-directory rewrites.

IMPORTANT: DocumentRoot directive is used only for compatibility with apache mod_rewrite. It is not necessary to use unless you don't use the server variable DOCUMENT_ROOT. By using this directive you do NOT override the root directory configured in IIS Manager. Also, you must always keep in mind that due to IIS's "virtual directory" feature, certain resources may be located in a directory structure completely out of the root directory.

This directive can be used only once in a rewrite configuration.

Configuration context
  • per-server configurations
  • per-virtual-host configurations

DocumentRoot fullpath

It requires only one argument. fullpath is the full path to a valid directory that is used as the root of a webserver or a website.

Download and try
IIS Mod-Rewrite

IIS rewrite

Download IIS Mod-Rewrite

Purchase IIS Mod-Rewrite