473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

301 redirect with select

229 100+
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
Sep 17 '08 #1
2 1401
JamieHowarth0
533 Expert 512MB
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
Sep 19 '08 #2
fran7
229 100+
Dear medicineworker, Thanks just what I needed.
Great
Richard
Sep 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: J.A. | last post by:
Hi, I'm new with PHP I want to create a page to redirect links, for example: http://www.php.net/link.php?link_id=2005 ....and be redirect to a URL, from my databse (MySQL), like it follow:...
3
by: Bill | last post by:
I have a page that contains processed variables that I'd like to forward using the response.redirect method. However, because the response.redirect contains the page within "pagename.asp", I have...
3
by: neil_pat | last post by:
I have a stored procedure which returns a value of between 0 and 4. I want the user to press a button to receive feed back on their last input. The save button takes the input and saves it to...
1
by: Petterson Mikael | last post by:
Hi, I am using xalan. In my stylesheet I have the following snippet to write to std out when a specific error occurs. <xsl:template name="class_error"> <xsl:param name="class"/> <xsl:param...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
2
by: scar5308 | last post by:
I have been struggling with this problem for over a week and am not much nearer a solution. I am trying to create a multi language site that only requires the content to be added as simple text or...
6
by: dragiton | last post by:
ASP Code Redirect Error Hello I recently relaunched a website containing asp code which used to work perfectly. However, after resetting up the SQL DB and trying to work out some site bugs I have...
18
by: Paul Lautman | last post by:
JRough wrote: What do you mean by "redirect the output to Excel"??? Excel isn't a location, it's a spreadsheet program that some (but not all users) will have on their machine. BTW, Location:...
2
by: fran7 | last post by:
Hi, I have this select redirect that doesnt work, only the case else works, anyone see whats wrong with it? Its basically to redirect my dynamic pages to their new homes. Any help appreciated....
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.