Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何使用参数重定向asp页面_Asp.net_Redirect_Parameters - Fatal编程技术网

Asp.net 如何使用参数重定向asp页面

Asp.net 如何使用参数重定向asp页面,asp.net,redirect,parameters,Asp.net,Redirect,Parameters,我正在做一些301重定向,从一个旧的asp网站到一个新的php网站 我现在遇到了一个问题,希望有人知道: 如何根据这些参数将带有参数的asp页面重定向到不同的目标页面 例如: http://www.olddomain.co.uk/temp.asp?tn=619&Cat=<cat_a>Personalised Work 但是 如您所见,两者都调用temp.asp,但参数不同 注意:对于直截了当的页面,我使用: <%@ Language=VBScript %> &l

我正在做一些301重定向,从一个旧的asp网站到一个新的php网站

我现在遇到了一个问题,希望有人知道:

如何根据这些参数将带有参数的asp页面重定向到不同的目标页面

例如:

http://www.olddomain.co.uk/temp.asp?tn=619&Cat=<cat_a>Personalised Work
但是

如您所见,两者都调用temp.asp,但参数不同

注意:对于直截了当的页面,我使用:

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" 
Response.AddHeader "Location", "http://newdomain.com/page_name"
Response.End
%>

有什么想法吗?
谢谢

我建议获取查询字符串。然后检查其中是否有某个子字符串

dim theString
theString = Request.QueryString("Cat")

if instr(theString, "Personalised Designs")
then 
Response.Redirect "http://thomasnayler.com/13-personalised-designs"
else
Response.Redirect "http://thomasnayler.com/12-personalised-work"

看起来您使用的是经典ASP,而不是ASP.NET。这是真的吗?这会在temp.asp的顶部,对吗?谢谢,那可能有用:-)工作得很好!谢谢,马修:-)
http://thomasnayler.com/13-personalised-designs
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" 
Response.AddHeader "Location", "http://newdomain.com/page_name"
Response.End
%>
dim theString
theString = Request.QueryString("Cat")

if instr(theString, "Personalised Designs")
then 
Response.Redirect "http://thomasnayler.com/13-personalised-designs"
else
Response.Redirect "http://thomasnayler.com/12-personalised-work"