RewriteEngine on  


RewriteCond %{HTTP_HOST} ^blog.chosenet.com$
RewriteCond %{REQUEST_URI} !^/blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /blog/$1
RewriteCond %{HTTP_HOST} ^blog.chosenet.com$
RewriteRule ^(/)?$ blog/ [L]

RewriteCond %{HTTP_HOST} ^bbs.chosenet.com$
RewriteCond %{REQUEST_URI} !^/bbs/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /bbs/$1
RewriteCond %{HTTP_HOST} ^bbs.chosenet.com$
RewriteRule ^(/)?$ bbs/ [L]
 
 
 
//可以实现多文件的二级域名冲重定向

RewriteCond %{HTTP_HOST} ^(.*).chosenet.com$
RewriteCond %{REQUEST_URI} !^/%1/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /%1/$1                                       //运行路径blog.chosenet.com
RewriteCond %{HTTP_HOST} ^(.*).chosenet.com$
RewriteRule ^(/)?$ %1/ [L]                        

相关文章:

  • 2022-12-23
  • 2021-05-20
  • 2021-12-25
  • 2022-02-09
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案