子域名的htaccess

时间:2011-05-28 05:11:05

标签: regex .htaccess mod-rewrite

如何将示例网址翻译为所需的网址?

From

http://test.at.domain.com

To

http://domain.com/at/index.php?id=test

1 个答案:

答案 0 :(得分:1)

RewriteEngine on
RewriteCond %{HTTP_HOST} (\w+).at.domain.com [NC]
RewriteRule .* http://domain.com/at/index.php?id=%1 [L]