Last updated October 3, 2013. Created by chicagomom on August 24, 2009.
Edited by craig.norris, Kyle Skrinak, dbdot, annahlauren. Log in to edit this page.

Note: By default, Windows cannot uncompress files saved in the .tar.gz format. This page assumes that you've downloaded and installed the freely available 7-Zip utility to extract .tar.gz files. A number of other file compression utilities are also available.

To download Drupal on your Windows computer:

  1. On the Drupal project download page find the version that you want to download. In this case, select the first Drupal 7 version under the section 'Official Releases.' Click Download and save the file without opening it.
  2. Right-click the .tar.gz Drupal installation file, and then select 7-Zip >> Extract here.

    The utility extracts a .tar file.

  3. Right-click the .tar file, and then select 7-Zip >> Extract here.

    You will now see the final Drupal folder. Drag the folder to where you need it to be in the file hierarchy.

    Notes:

    • If you extract the files into a folder other than your web site's folder, copy the contents of the Drupal folder into the appropriate web folder, rather than cutting/pasting them. (This will ensure the files will inherit the appropriate permissions for the web server.)
    • If you're using Apache instead of IIS, skip the remaining steps on this page.
  4. In the sites/default folder, create a folder called files and grant modify permissions for it to IIS_WPG (IIS6) or IIS_IUSRS (IIS7).
  5. Drupal distributions come with .htaccess files for *nix use. IIS7 users should convert this file to a web.config file for their site. If you have used the IIS Manager to create a new site, a basic web.config file will exist in your site's root directory. Edit the file to look like this example:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
      <!-- Don't show directory listings for URLs which map to a directory. -->
        <directoryBrowse enabled="false" />
        <!--
           Caching configuration was not delegated by default. Some hosters may not delegate the caching
           configuration to site owners by default and that may cause errors when users install. Uncomment
           this if you want to and are allowed to enable caching
         -->
        <!--
        <caching>
          <profiles>
            <add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
            <add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00" />
          </profiles>
        </caching>
         -->
        <rewrite>
          <rules>
            <!-- rule name="postinst-redirect" stopProcessing="true">
              <match url=".*" />
              <action type="Rewrite" url="postinst.php"/>
            </rule -->
            <rule name="Protect files and directories from prying eyes" stopProcessing="true">
              <match url="\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|postinst.1|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$" />
              <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
            </rule>
            <rule name="Force simple error message for requests for non-existent favicon.ico" stopProcessing="true">
              <match url="favicon\.ico" />
              <action type="CustomResponse" statusCode="404" subStatusCode="1" statusReason="File Not Found" statusDescription="The requested file favicon.ico was not found" />
            </rule>
                    <!-- To redirect all users to access the site WITH the 'www.' prefix,
                    http://example.com/... will be redirected to http://www.example.com/...)
                    adapt and uncomment the following:   -->
                    <!--
            <rule name="Redirect to add www" stopProcessing="true">
              <match url="^(.*)$" ignoreCase="false" />
              <conditions>
                <add input="{HTTP_HOST}" pattern="^example\.com$" />
              </conditions>
              <action type="Redirect" redirectType="Permanent" url="http://www.example.com/{R:1}" />
            </rule>
                    -->
                    <!-- To redirect all users to access the site WITHOUT the 'www.' prefix,
                    http://www.example.com/... will be redirected to http://example.com/...)
                    adapt and uncomment the following:   -->
                    <!--
            <rule name="Redirect to remove www" stopProcessing="true">
              <match url="^(.*)$" ignoreCase="false" />
              <conditions>
                <add input="{HTTP_HOST}" pattern="^www\.example\.com$" />
              </conditions>
              <action type="Redirect" redirectType="Permanent" url="http://example.com/{R:1}" />
            </rule>
                    -->
            <!-- Rewrite URLs of the form 'x' to the form 'index.php?q=x'. -->
            <rule name="Short URLS" stopProcessing="true">
              <match url="^(.*)$" ignoreCase="false" />
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
              </conditions>
              <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
            </rule>
          </rules>
        </rewrite>
        <!-- httpErrors>
          <remove statusCode="404" subStatusCode="-1" />
          <error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" />
        </httpErrors -->
        <defaultDocument>
         <!-- Set the default document -->
          <files>
            <remove value="index.php" />
            <add value="index.php" />
          </files>
        </defaultDocument>
      </system.webServer>
    </configuration>

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

"The configuration section 'rewrite' cannot be read because it is missing a section declaration "

I've reverted back to V6 and all is good, but following instructions and going to V7 on Windows causes this to happen every time. I've checked the web.config file and it matches this..

I received the same error. I solved it by installing the "URL Rewrite Module 2.0":

http://www.iis.net/download/URLRewrite

I am installing Drupal on Windows ( I already have an Apache HTTP Server, MySQL, PHP, etc., all working just fine on my localhost) and was about to tackle this step 4:
"IIS7: Create/modify web.config file. Drupal distributions come with .htaccess files for *nix use; IIS7 users should convert this file to a web.config file for their site. If you have used the IIS Manager to create a new site, a basic web.config file will exist in your site's root directory. Edit the file to look like this example:"

But based on the few comments preceding mine, I am skeptical about making all the conversions to my already present web.config file to get it to match "this example". Also, I have not knowingly "used the IIS Manager to create a new site", and don't even know what that means. My unzip included a web.config file, it will indeed require editing to match the example, but can someone tell me if things will then work, whatever those "things" turn out to be.

Guess I'll read on for now. I do wonder why my already existing web.config file is not really closely alike the example.

richos

web.config files are used by IIS web server software, not Apache, which uses .htaccess files. If you are running Apache, you don't need a web.config file, these rules will be contained in your server's .htaccess file.

The web.config above has alot of content i dont think is needed. i will post what i use below and best of all, it doesnt need editing. The redirect is wildcard (it will automatically correctly redirect for your url to add www.). its also worth noting that this one adds the MP4 extention as an exception as IIS blocks this by default, so if anyone is having issues playing MP4 files on thier drupal site, this might help.

If you wish to redirect to remove www, you can edit accordingly. Oh and clean URLS and path auto work with this, something that i have seen other config files struggle to support.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
     <directoryBrowse enabled="false" />
<staticContent>
            <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
            <mimeMap fileExtension=".m4v" mimeType="video/m4v" />
     </staticContent>
     <rewrite>
      <rules>
         <rule name="Protect files and directories from prying eyes" stopProcessing="true">
            <match url=".(engine|inc|info|install|module|test|po|sh|sql|postinst.1|theme|tpl(.php)?|xtmpl|svn-base)$|^(code-style.pl|Entries.|Repository|Root|Tag|Template|all-wcprops|entries|format)$" />
            <action type="CustomResponse" statusCode="403" subStatusCode="0" statusReason="Forbidden" statusDescription="Access is forbidden." />
          </rule>
        <rule name="Redirect to add www" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions>
            <add input="{HTTP_HOST}" negate= "true" pattern="^www\.(.+)$" />
          </conditions>
          <action type="Redirect" redirectType="Permanent" url="http://www.{HTTP_HOST}/{R:1}" appendQueryString="true" />
        </rule>
          <rule name="Short URLS" stopProcessing="true">
             <match url="^(.*)$" ignoreCase="false" />
             <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
              <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
             </conditions>
             <action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
          </rule>
      </rules>
     </rewrite>
  </system.webServer>
</configuration>

replace your web.config with above, and you should be good to go.

-NOTE- if your site is installed on a subdomain (e.g. yoursite.domain.com) comment out the redirect or it will break.

feel free to pull this appart :P

edit was to code post, i posted the wrong webconfig origonally.. oops

RTFM!
Issue solved? Add [Solved] to the issue title.
For further support or projects contact me.


The Communications Group

When I edit a file web.config as shown here, I get an error 500.
Also, in the control panel IIS7, I can not edit the option "Default Document" - comes out this error:

"There was en error while performing this operation.
Details:
Filename: \\?\С:inetpub\new\web.config"

If I change the file web.config to the original - that everything is OK.
what could be wrong?

there might be something specific in it...

i posted this a while ago, and I haven't been using IIS for nearly a year now.. I think your best bet here would be to use the original, and take the bits out of my web.config that you need :) (the most useful bit is the wildcard redirect). I will post a new version when I get a chance to play with it, but for now use the original.

Sorry about that

RTFM!
Issue solved? Add [Solved] to the issue title.
For further support or projects contact me.


The Communications Group

I too get this error when I use the example above.
Reading about URLrewrites for the benefit of search engines makes me nervous - isn't Drupal optimised for SEO ?
Why does following the documentation lead to errors?
(I point this out to help improve, not to just criticise)
NB: using the web.config included in the download gives an equally perplexing error:
---line number:6, the config section "rewrite" cannot be read as its missing.
BUT its not missing, so whats going on???? I know I wont get the answer here, but would some 'expert' please correct the documentation.
Thanks, Jon

As Im Here, I must be Not All There!
"Just because you don't understand, doesn't mean there are gods" The Man 13:8

This error
The configuration section 'rewrite' cannot be read because it is missing a section declaration.
means URL Rewrite isnt installed.
It can be downloaded from here
http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rew...

or you could just not bother with Rewrites...

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <directoryBrowse enabled="false" />
    <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath="" path="/index.php" responseMode="ExecuteURL" />
    </httpErrors>
    <defaultDocument>
      <files>
        <remove value="index.php" />
        <add value="index.php" />
      </files>
    </defaultDocument>
  </system.webServer>
</configuration>

As Im Here, I must be Not All There!
"Just because you don't understand, doesn't mean there are gods" The Man 13:8