ARTICLES
小窍门伪静态实现虚拟主机子目录绑定二级域名
2015-07-26 16:08:210字号:
  1. RewriteEngine on
  2. RewriteCond %{HTTP_HOST} ^en.xxx.$com [NC]
  3. RewriteRule ^(.*)$/en/$1 [QSA,PT,L]

把 en.xxx.com 绑定到en目录

  1. RewriteEngine On
  2. RewriteCond %{REQUEST_URI} !^/html/en/.*
  3. RewriteCond %{HTTP_HOST} =en.xxx.com
  4. RewriteRule ^(.*) /html/en/$1 [L]
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3.   <system.webServer>
  4.     <rewrite>
  5.       <rules>
  6.        <rule name="Imported Rule 2">
  7.           <match url="^.*$" ignoreCase="false" />
  8.           <conditions>
  9.             <add input="{HTTP_HOST}" pattern="^en.xxx.com$" />
  10.           </conditions>
  11.           <action type="Rewrite" url="/html/en/{R:0}" appendQueryString="true" />
  12.     </rule>
  13.       </rules>
  14.     </rewrite>
  15.   </system.webServer>
  16. </configuration>