Microsoft's Internet Information Server ( MS IIS ) is very different from Apache, and you need to handle redirects on it differently.
Although you can use the popular FrontPage web development software with Apache + FP extensions, most people who use FrontPage prefer to use IIS. Also, Microsoft's .NET and ASP development platforms usually work best on MS IIS (no surprise there).
Definitions for Terms used in this Article
Detailed Information
Overview
What you are trying to accomplish here is to have one resource (either a page or an entire site) redirect a visitor to a completely different page or site, and while doing so tell the visitor's browser that the redirect is either permanent (301) or temporary (302).
Therefore you need to do three things:
Have 2 resources - one source page or website, and one destination page or website.
When an attempt to access the source resource is made, IIS transfers the visitor to the destination instead.
During the transfer, IIS reports to the visitor that a redirect is happening and it's either temporary or permanent.
The good news is that IIS has always supported this, and you can use it's control panel to make the redirect.
Administrator Mode - Redirecting a Domain
If you can log into the Windows 2000 (or higher) server and access the desktop, then choose:
Start > Programs > Administrative Tools > Internet Services Manager
只能输入数字:"^[0-9]*$"。
只能输入n位的数字:"^\d{n}$"。
只能输入至少n位的数字:"^\d{n,}$"。
只能输入m~n位的数字:。"^\d{m,n}$"
只能输入零和非零开头的数字:"^0|[1-9][0-9]*$"。
只能输入有两位小数的正实数:"^[0-9]+(\.[0-9]{2})?$"。
只能输入有1~3位小数的正实数:"^[0-9]+(\.[0-9]{1,3})?$"。
只能输入非零的正整数:"^\+?[1-9][0-9]*$"。
Tags: 正则表达式
ServerName domain.com
RewriteEngine on
RewriteRule ^(.*)$ http://www.domain.com$1 [R=301,L]
</VirtualHost>
如果没有mod_rewrite也可以设置mod_alias: