Drupal在IIS7中通过Web.config实现URL Rewrite

首先在Drupal安装目录中创建内容如下的Web.config文件:

<?xml version=”1.0″ encoding=”UTF-8″?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name=”Drupal Clean URLs” stopProcessing=”true”>
                        <match url=”^(.*)$” />
                        <conditions>
                            <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” />
                            <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” />
                        </conditions>
                        <action type=”Rewrite” url=”index.php?q={R:1}” appendQueryString=”true” />
                    </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

然后,在Drupal管理界面中启用Clean URLs:

(参考文章:http://learn.iis.net/page.aspx/505/install-drupal-on-iis/)

发表回复

 

 

 

你可以使用如下HTML标签

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>