Connecting Tech Pros Worldwide Help | Site Map
Reply
 
LinkBack Thread Tools Search this Thread
  #1  
Old September 17th, 2008, 06:26 PM
Familiar Sight
 
Join Date: Jul 2006
Posts: 133
Default 301 redirect with select

Hi, anyone know how to write a select or if 301 redirect

Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %>
  2. <%
  3. ' Permanent redirection
  4. Response.Status = "301 Moved Permanently"
  5. Response.AddHeader "Location", "./"
  6. Response.End
  7. %>
basicall I need if
http://www.mysite/direct?cat=2
is requested redirect to new page
if
http://www.mysite/direct?cat=5
is requested redirect to its new page
and so on


Thanks if anyone knows
Richard
Reply
  #2  
Old September 19th, 2008, 04:02 PM
codegecko's Avatar
Moderator
 
Join Date: May 2007
Location: United Kingdom
Age: 21
Posts: 348
Default

Hi Richard,

You want something like this:

Expand|Select|Wrap|Line Numbers
  1. 'This checks to see if the "cat=5" bit in http://mysite.com/direct?cat=5 actually
  2. ' exists, then we can do something with it
  3. If Len(Request.QueryString("cat")) > 0 Then
  4. 'Let's redirect
  5. Response.AddHeader("Status", "301 Moved Permanently")
  6. Response.AddHeader("Location", "Your_new_url.asp")
  7. End If
  8. Response.End
  9.  
Hope this helps.

medicineworker
Reply
  #3  
Old September 22nd, 2008, 10:40 AM
Familiar Sight
 
Join Date: Jul 2006
Posts: 133
Default

Dear medicineworker, Thanks just what I needed.
Great
Richard
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 204,687 network members.
Post your question now . . .
It's fast and it's free

Popular Articles