Redirect URL (Should be simple?)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user65
    New Member
    • May 2010
    • 23

    Redirect URL (Should be simple?)

    I would like to redirect this URL:
    An Online Database of the Left and its Agendas, a Guide to the Political Left

    to this URL:
    An Online Database of the Left and its Agendas, a Guide to the Political Left


    I can't seem to find a solution through Google, I can't simply add a 301 redirect because this page was created dynamically.
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Code:
    response.redirect "http://www.discoverthenetworks.org/groupProfile.asp?grpid=7522"
    Is this what you are looking for?

    Jared

    Comment

    • user65
      New Member
      • May 2010
      • 23

      #3
      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?

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        absolutely, explain the logic of when you need to redirect, and I'll try to outline the code (or pseudo-code).

        Jared

        Comment

        • user65
          New Member
          • May 2010
          • 23

          #5
          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:
          Code:
          <%
          varHost = Request.ServerVariables("HTTP_HOST")
          varPage = Request.ServerVariables("SCRIPT_NAME")
          varQuery = Request.ServerVariables("QUERY_STRING")
          If varHost = "discoverthenetworks.org" OR "www.discoverthenetworks.org then
          Response.Status="301 Moved Permanently"
            If varPage = "/groupprofile.asp" then
              If varQuery = "grpid=6967"
                Response.AddHeader "Location", "newlocation.asp"
              End If
          End If
          %>

          Comment

          • jhardman
            Recognized Expert Specialist
            • Jan 2007
            • 3405

            #6
            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?

            Comment

            • user65
              New Member
              • May 2010
              • 23

              #7
              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.as p. How would I use a redirect to detect a specific request (grpid=6967) to redirect to the correct location (grpid=7522)?

              Comment

              • user65
                New Member
                • May 2010
                • 23

                #8
                I am thinking this would be best for my current situation, but I keep getting an error when implementing.

                Code:
                <%
                varHost = Request.ServerVariables("HTTP_HOST")
                varPage = Request.ServerVariables("SCRIPT_NAME")
                varQuery = Request.ServerVariables("QUERY_STRING")
                If varHost = "discoverthenetworks.org" OR "www.discoverthenetworks.org then
                Response.Status="301 Moved Permanently"
                  If varPage = "/groupProfile.asp" then
                    If varQuery = "grpid=6967"
                      Response.AddHeader( "/groupProfile.asp?grpid=6967", "/groupProfile.asp?grpid=7522")
                    End If
                End If
                %>

                Comment

                • jhardman
                  Recognized Expert Specialist
                  • Jan 2007
                  • 3405

                  #9
                  instead of looking for the request.serverv ariables("query string"), look for the request.queryst ring("grpid"). What error are you getting?

                  Jared

                  Comment

                  • user65
                    New Member
                    • May 2010
                    • 23

                    #10
                    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?

                    Comment

                    Working...