2011-08-07 49 views
0

我有一個內聯網被分類爲admin/mgmt/rest。網址是intranet.com。對於管理內部網將是intranet.com/erw,它不會超過3個字符。我想使用.htaccess 3個字符重定向到特定的URL。.htaccess重定向限制字符到URL

RewriteCond %{HTTP_HOST} ([0-9][a-z]) [NC] <--want a limit of 3 characters only 
RewriteRule (.*)$ http://intranet.com/tek 

回答

0

我不知道如果我理解

# match all intranet 1-3 length domains 
RewriteCond %{HTTP_HOST} ^([0-9a-z]{1-3})$ [NC] 
# redirect to url with domain name 
RewriteRule (.*)$ http://intranet.com/%1