将子域redirect到特定页面

我正在尝试将http://pk.domain.comredirect到http://www.domain.com/home.php?country=pk ,同样地http://www.domain.com/pk/ http://www.domain.com/home.php?country=pk

Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.domain\.com$ [NC] RewriteRule ^([^/]+)/?$ adlisting.php?country=%1&category=$1 [L,QSA] RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.domain\.com$ [NC] RewriteRule ^([^/]+)/([^/]+)/?$ adlisting.php?country=%1&location=$1&category=$2 [L,QSA] RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^([az]{2})/([^/]+)/?$ adlisting.php?country=$1&category=$2 [L,QSA,NC] RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^([az]{2})/([^/]+)/([^/]+)/?$ adlisting.php?country=$1&location=$2&category=$3 [L,QSA,NC] 

这个问题与多国使用.htacces链接

在其他规则之前为着陆页添加2条规则:

 Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.domain\.com$ [NC] RewriteRule ^/?$ home.php?country=%1 [L,QSA] RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^([az]{2})/?$ home.php?country=$1 [L,QSA,NC] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.domain\.com$ [NC] RewriteRule ^([^/]+)/?$ adlisting.php?country=%1&category=$1 [L,QSA] RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.domain\.com$ [NC] RewriteRule ^([^/]+)/([^/]+)/?$ adlisting.php?country=%1&location=$1&category=$2 [L,QSA] RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^([az]{2})/([^/]+)/?$ adlisting.php?country=$1&category=$2 [L,QSA,NC] RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^([az]{2})/([^/]+)/([^/]+)/?$ adlisting.php?country=$1&location=$2&category=$3 [L,QSA,NC]