Drupal (all versions)
RewriteCond %{HTTP_HOST} ^(www\.yourdomainname\.com).*$ [I]
RedirectRule ^/(.*)$ http://yourdomainname.com/$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(?!favicon.ico$)([^?]*)(?:\?(.*))?$ /index.php?q=$1&$2 [L]
WordPress (all versions)
RewriteCond %{HTTP_HOST} ^(yourdomainname\.com).*$ [I]
RedirectRule ^/(.*)$ http://www.yourdomainname.com/$1 [I,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/(.*)$ /index.php/$1 [L]
IIS下rewrite存在的主要问题还是中文分类和tag的问题,不是很好解决,上面的规则在英文站点下没有任何问题。