|
|
不能分别定义根目录,只能采取重写路径的办法。
nginx:
- if ($http_host ~ domain\.com\.$) {
- rewrite ^((?!/0\.2020).*)$ /0.2020$1? last;
- }
- if ($http_host ~ domain\.com$) {
- rewrite ^/0\.2020.*$ /404.html last;
- }
复制代码
apache:
- <Directory "d:/www/com.domain.www">
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /
- RewriteCond %{HTTP_HOST} ^www\.domain\.com\.$ [NC]
- RewriteCond %{REQUEST_URI} !^/0.dot/
- RewriteRule ^(.*)$ /0.dot/$1 [QSA,L]
- </IfModule>
- </Directory>
- <Directory "d:/www/com.domain.www/0.dot">
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /
- <If "%{HTTP_HOST} != %{SERVER_NAME}.'.'">
- RewriteRule ^ - [R=404,L]
- </If>
- </IfModule>
- </Directory>
复制代码 |
|