Mod-Rewrite

子域重定向到文件

  • July 15, 2012

這是我的htaccess:

RewriteCond     %{HTTP_HOST}                                 ^(?:www\.)?(.+?)\.imvu-e\.com$
RewriteCond     /var/imvu/products/ht/clients/%1/            -d
RewriteRule     ^(.+)                                        %{HTTP_HOST}$1
RewriteRule     ^(?:www\.)?([^.]+?)\.imvu-e\.com/(.*)        /var/www/imvu/products/ht/clients/$1/$2 [L]

我想

anything.imvu-e.com重定向到文件/var/imvu/products/ht/clients/anything/

因此http://anything.imvu-e.com/woot.php?var=4/var/imvu/products/ht/clients/anything/woot.php發送它var=4

現在訪問它的方式是http://www.imvu-e.com/products/ht/clients/anything/woot.php?var=4

換個不錯的怎麼樣VirtualDocumentRoot

VirtualDocumentRoot /var/imvu/products/ht/clients/%-3

引用自:https://serverfault.com/questions/407831