473,396 Members | 1,998 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,396 software developers and data experts.

Redirect URL (Should be simple?)

23
I would like to redirect this URL:
http://www.discoverthenetworks.org/g...asp?grpid=6967
to this URL:
http://www.discoverthenetworks.org/g...asp?grpid=7522

I can't seem to find a solution through Google, I can't simply add a 301 redirect because this page was created dynamically.
May 14 '10 #1
9 2385
jhardman
3,406 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. response.redirect "http://www.discoverthenetworks.org/groupProfile.asp?grpid=7522"
Is this what you are looking for?

Jared
May 17 '10 #2
user65
23
Thanks for the reply Jared.

I saw this type of redirect when researching on google, but would I be able to implement this on a dynamic page?
May 20 '10 #3
jhardman
3,406 Expert 2GB
absolutely, explain the logic of when you need to redirect, and I'll try to outline the code (or pseudo-code).

Jared
May 21 '10 #4
user65
23
OK,

Any time someone visits: http://www.discoverthenetworks.org/g...asp?grpid=6967, I would need it to be forwarded to the second URL: http://www.discoverthenetworks.org/g...asp?grpid=7522.

If you check out the URL's, one is a blank page, and the other has content. I just need to forward the blank page to the one that has content. I'm not sure how to add this code since the pages are loaded dynamically and I don't have a way to edit it outside of the database. (I think.)

If you have a solution that would be great, I did come across this - but again, I'm not sure where to add it:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. varHost = Request.ServerVariables("HTTP_HOST")
  3. varPage = Request.ServerVariables("SCRIPT_NAME")
  4. varQuery = Request.ServerVariables("QUERY_STRING")
  5. If varHost = "discoverthenetworks.org" OR "www.discoverthenetworks.org then
  6. Response.Status="301 Moved Permanently"
  7.   If varPage = "/groupprofile.asp" then
  8.     If varQuery = "grpid=6967"
  9.       Response.AddHeader "Location", "newlocation.asp"
  10.     End If
  11. End If
  12. %>
May 23 '10 #5
jhardman
3,406 Expert 2GB
so... you don't have access to the code at all. So how do you want to implement a redirect? An ASP redirect has to be put in the code ABOVE anything that is written to the screen. Even though you say the one page is blank, it has a menu and other stuff, so if you wanted to redirect, you would have to get into the ASP code that is generating the page.

Another option would be to add Javascript code to the blank page that would direct the user to the final page - that code could be put anywhere on the page. Does this make sense?
May 25 '10 #6
user65
23
OK, I started to think about it in a different mind set and understand what you mean. So I would need to edit the master page that displays this content, which in my case is groupProfile.asp. How would I use a redirect to detect a specific request (grpid=6967) to redirect to the correct location (grpid=7522)?
May 26 '10 #7
user65
23
I am thinking this would be best for my current situation, but I keep getting an error when implementing.

Expand|Select|Wrap|Line Numbers
  1. <%
  2. varHost = Request.ServerVariables("HTTP_HOST")
  3. varPage = Request.ServerVariables("SCRIPT_NAME")
  4. varQuery = Request.ServerVariables("QUERY_STRING")
  5. If varHost = "discoverthenetworks.org" OR "www.discoverthenetworks.org then
  6. Response.Status="301 Moved Permanently"
  7.   If varPage = "/groupProfile.asp" then
  8.     If varQuery = "grpid=6967"
  9.       Response.AddHeader( "/groupProfile.asp?grpid=6967", "/groupProfile.asp?grpid=7522")
  10.     End If
  11. End If
  12. %>
May 26 '10 #8
jhardman
3,406 Expert 2GB
instead of looking for the request.servervariables("querystring"), look for the request.querystring("grpid"). What error are you getting?

Jared
May 28 '10 #9
user65
23
A system error has occurred please contact your system administrator.

Doesn't give a line error or anything like that, so I am guessing this code I found isn't working with the way I'm modifying it.

Does my request make sense? would it be possible to add this in the header?
Jun 17 '10 #10

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

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
5
by: alexz | last post by:
I'm redirecting a value to a page called update.asp from somepage.asp Recid = Request.QueryString("qryCategory") Response.redirect "update.asp?" & Recid So it shows like /update.asp?3 ...
3
by: Robert Sorger | last post by:
I have a problem with thread execution after calling response.redirect() in a web form. Basically, I want the thread to continue to work (e.g. do some long database work) but want to redirect...
1
by: Eric | last post by:
I have the following situation: I was getting intermittent errors using Reponse.Redirct("url", true) and was trying to catch the ThreadAbortException, but it was not staying caught and was showing...
14
by: gaurav tyagi | last post by:
in my appplication if i try to go to next page using response.redirect, it does not work and control remains on same page but if i use server.transfer control goes to nex page?? can any one...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
1
by: stevebremermn | last post by:
I'm working on setting up some affiliate links on a site of mine and I haven't been able to get a redirect to work. The original affiliate link looks like this: ...
7
by: ses | last post by:
How do i implement server side redirect when the request was submitted using AJAX?
6
by: sjledet | last post by:
I'm trying to figure out what I have wrong in the following code. It's located at http://www.ledet.com/locations/location.aspx If I call this page with...
4
by: myalo | last post by:
In the transition of a website from one domain to another for exmaple from www.oldsite.com to www.newsite.com I need to "rewrite" the URL so all links to the old site will be linked to the new site...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.