IIIS 301 重定向带参数的问题

 

网站更换域名,把旧域名用301指到新域名来。

从 iis 中设置一下就行,看上去很容易,用了一会儿才发现,参数都没有带上。

从ms网站上找到如下说明,果然好使:)

变量 描述 示例

$S

将请求的 URL 的后缀传递给新的 URL。后缀是用重定向的 URL 代替之后,初始 URL 中所保留的部分。

如果未设置 EXACT_DESTINATION 标志,则结果目标 URL 的名称将具有所请求文件的名称(作为文件夹名称)以及文件名本身。

如果映射到以下网站的虚拟目录:

http://fabrikam/Scripts

配置为重定向到以下确切的 URL:

http://fabrikam/NewScripts$S

对以下 URL 的新请求:

http://fabrikam/Scripts/Program.exe

将自动重定向至以下 URL:

http://fabrikam/NewScripts/Program.exe

$P

将初始 URL 中的参数(如 querystring 参数)传递至新的 URL,不包括问号 (?)。

如果映射到以下网站的虚拟目录:

http://fabrikam/Scripts

配置为重定向到以下 URL:

http://fabrikam/NewScripts$P

对以下 URL 的新请求:

http://fabrikam/Scripts/File.asp?var1=5&var2=6

将自动重定向至以下 URL:

http://fabrikam/NewScriptsvar1=5&var2=6

$Q

将初始 URL 中的参数(如 querystring 参数)传递至新的 URL,包括问号 (?)。

如果映射到以下网站的虚拟目录:

http://fabrikam/Scripts

配置为重定向到以下确切的 URL:

http://fabrikam/NewScripts$S$Q

对以下 URL 的新请求:

http://fabrikam/Scripts/File.asp?var1=5&var2=6

将自动重定向至以下 URL:

http://fabrikam/NewScripts/File.asp?var1=5&var2=6

$V

传递请求的 URL,不包括服务器名和任何参数。要包含参数,可使用 $P 或 $Q 变量及 $V 变量。

如果未设置 EXACT_DESTINATION 标志,则结果目标 URL 的名称将具有所请求文件的名称(作为文件夹名称)以及文件名本身。

如果映射到以下网站的虚拟目录:

http://fabrikam/Scripts

配置为重定向到以下确切的 URL:

http://contoso$V

对以下 URL 的新请求:

http://fabrikam/Scripts/File.asp

将自动重定向至以下 URL:

http://contoso/Scripts/File.asp

 

from: http://www.microsoft.com/technet/prodtechnol/windowsserver2003/zh-chs/library/iis/41c238b2-1188-488f-bf2d-464383b1bb08.mspx?mfr=true

 

Print | posted on Saturday, May 19, 2007 1:34 AM

Feedback


# AlexaRank 8/19/2007 7:44 AM MrRobby

I want see AlexaRank of your site and buy links. How I do this?


# indoor chair cushions 8/21/2007 3:51 PM indoor chair cushions

Where I see gallery?


# Newburgh Samantha Bebo 8/24/2007 10:17 PM Newburgh Samantha Bebo

Bebo сommunity, share your blogs


# buy phentermine 9/5/2007 6:18 PM phentermine

How much does it cost to deploy a banner on your blog?


# DE Blog 9/8/2007 12:50 AM RKirk

Wieviel kostet es, um eine Fahne auf deinem blog zu entfalten?


# buy levitra 10/25/2007 12:07 PM buy levitra

I wanted add your site to blogroll...


# MP3 Music Downloads 10/25/2007 11:26 PM Buy MP3 Music Online

How add your site to reddit?


# Link Exchange 10/26/2007 5:10 PM GeorgeS

How add your site to social bookmarks?


# buy levitra 10/26/2007 6:42 PM buy levitra

How add your site to technorati?


# levitra 10/29/2007 6:34 PM levitra

How add your site to technorat?


# online casino 10/29/2007 7:26 PM online casino

How add your site to technorats?


# mp3 downloading 20 11/1/2007 3:43 AM mp3 downloading 20

Voglio aggiungere il tuo blog in un forum


# Buy mp3 online download 11/6/2007 6:52 PM Buy download legally mp3

How add your site to technorates?


# fosamax 11/9/2007 1:17 AM fosamax

How add your site to digg?


# buy cialis 11/11/2007 8:27 PM buy cialis

How add your site to propeller?


# phentermine 11/13/2007 8:11 PM phentermine

How add your to red?


# ac dc download mp3 11/14/2007 5:08 PM 50 cent mp3 downloads

add to altavista...


# levitra 11/14/2007 9:16 PM levitra

How add your to reds?

Title  
Name  
Email
Url
Comments   
Please add 7 and 3 and type the answer here: