继续Drupal分享精神 QQ群:107748121 站长QQ:2275288328 skype: hellodrupal【drupal交流+drupal 建站+theme制作】
登录 注册

Drupal IIS 下配置 Clean URL 方法和 rewrite 规则,ISAPI Rewrite

一般情况下,有的虚拟主机服务商配置好iis,有的服务器支持iis rewrite,所以不要自己配置,在购买前可以咨询服务器提供商。
具体的drupal [ISAPI_Rewrite] 规则如下;

[ISAPI_Rewrite]

# Accept a url with the following directories and pass them through unchanged.
RewriteRule /(?:misc|files|modules|themes|sites|uploads)/(.*) $0 [I,L]

# Make URLs sane
RewriteRule /cron\.php $0 [I,L]
RewriteRule /index\.php.* $0 [I,L]
RewriteRule /update\.php.* $0 [I,L]
RewriteRule /xmlrpc\.php $0 [I,L]

# deactivate following line if "robotstxt" module is installed
#RewriteRule /robots\.txt.* $0 [I,L]

RewriteRule /(.*)\?(.*) /index.php\?q=$1&$2 [I,L]
RewriteRule /(.*) /index.php\?q=$1 [I,L]

比如我这里的测试环境,iis,只要把这个规则拷贝到httpd.ini里面即可。然后上传到虚拟主机的根目录里,然后去drupal的管理后台就可以看到,clean url 简介衔接模式,已经处于可选状态了。

评论

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.