一般情况下,有的虚拟主机服务商配置好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 简介衔接模式,已经处于可选状态了。
评论
发表新评论