If Querystring = Value, Redirect?

  • Thread starter Badass Scotsman
  • Start date
B

Bob Barrows [MVP]

Badass said:
Hello,

I have a dynamically generated site, with a URL format like so:

www.site.com/index.aspx?Content=Horses
www.site.com/index.aspx?Content=Parrots
And so on...

What i would like to do, on page somewhere, is this:

if QueryString Content = Horses
then
301 permanent redirect to
www.newsite.com/animals.aspx?Content=Horses

Trouble is, not really knowing how to code in .NET , im stumped :(
Assuming you will use VB.Net, in the Page_Onload event handler, do this:

If Request.QueryString("Content") = "Horses" then
Response.Redirect("www.newsite.com/animals.aspx?Content=Horses")
End if
 
B

Badass Scotsman

Assuming you will use VB.Net, in the Page_Onload event handler, do this:
If Request.QueryString("Content") = "Horses" then
Response.Redirect("www.newsite.com/animals.aspx?Content=Horses")
End if


Hi,

Will the Response.Redirect have the same effect as a 301 permanently moved?
Will it return a 301 value to search engines? (Which is the sole reason for
this task...)

Regards,

Gary.
 
R

Ray Booysen

Badass said:
Hi,

Will the Response.Redirect have the same effect as a 301 permanently moved?
Will it return a 301 value to search engines? (Which is the sole reason for
this task...)

Regards,

Gary.
No it won't. Response.Redirect simply redirects the browser to the
specified page.
 
B

Bob Barrows [MVP]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top