- RewriteEngine on
- RewriteCond %{HTTP_HOST} ^en.xxx.$com [NC]
- RewriteRule ^(.*)$/en/$1 [QSA,PT,L]
把 en.xxx.com 绑定到en目录
- RewriteEngine On
- RewriteCond %{REQUEST_URI} !^/html/en/.*
- RewriteCond %{HTTP_HOST} =en.xxx.com
- RewriteRule ^(.*) /html/en/$1 [L]
- <?xml version="1.0" encoding="UTF-8"?>
- <configuration>
- <system.webServer>
- <rewrite>
- <rules>
- <rule name="Imported Rule 2">
- <match url="^.*$" ignoreCase="false" />
- <conditions>
- <add input="{HTTP_HOST}" pattern="^en.xxx.com$" />
- </conditions>
- <action type="Rewrite" url="/html/en/{R:0}" appendQueryString="true" />
- </rule>
- </rules>
- </rewrite>
- </system.webServer>
- </configuration>