小弟想将***.mem.abc.com域名指向http://www.abc.com/mem/index.php?uid=***,同时想将www.xyz.cn指向http://www.abc.com/mem/index.php?uid=sina,在htaccess中怎么写呢,俺自个儿写了个错的,求高手修改 RewriteEngine on 
RewriteCond %{HTTP_HOST} ^(.*).mem.abc.com$ 
RewriteRule ^(.*).mem.abc.com$ http://www.abc.com/mem/index.php?uid=$1 [L] RewriteCond %{HTTP_HOST} ^www.xyz.com$ 
RewriteRule ^www.xyz.com$ http://www.abc.com/mem/index.php?uid=sina [L]

解决方案 »

  1.   

    .htaccess可以这样用么。。第1个,不知道。
    第2个,给域名做url转向吧。
      

  2.   

    第一个,试试
    RewriteEngine on 
    RewriteCond ^(.*?).mem.abc.com$ 
    RewriteRule ^(.*?).mem.abc.com$ http://www.abc.com/mem/index.php?uid=$1 [L] 
    第二个,如果www.xyz.com不是本机域名,则要在域名商那作转向解析如果是本机域名,也可以重定向
      

  3.   

    RewriteEngine on
    RewriteRule ^([A-Za-z0-9_]+)/([0-9]+)_([0-9]+)\.html$ ?action=$1&id=$2&page=$3
    RewriteRule ^([A-Za-z0-9_]+)/([0-9]+)\.html$ ?action=$1&id=$2
    RewriteRule ^author/(.+)\.html$ ?action=author&id=$1
    RewriteRule ^([A-Za-z0-9_]+)/$ ?action=$1