小弟想将***.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]
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]
第2个,给域名做url转向吧。
RewriteEngine on
RewriteCond ^(.*?).mem.abc.com$
RewriteRule ^(.*?).mem.abc.com$ http://www.abc.com/mem/index.php?uid=$1 [L]
第二个,如果www.xyz.com不是本机域名,则要在域名商那作转向解析如果是本机域名,也可以重定向
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