Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:33:39+00:00 2026-06-07T23:33:39+00:00

As I have encountered very luck with managing to get querystrings to redirect correctly

  • 0

As I have encountered very luck with managing to get querystrings to redirect correctly previously just passing querystring parameters, and the over-arching advice across this site and webmasterworld for querystring redirection seems to be "deal with it as a RewriteCond querystring", I’m trying to use the following type rule for a set of about 10 URLs.

Example URL:

http://www.example.org/training_book.asp?sInstance=1&EventID=139

What I have so far:

RewriteCond %{QUERY_STRING} ^training_book.asp\?sInstance=1&EventID=139  
RewriteRule /clean-landing-url/ [NC,R=301,L]

So, what I want to happen is

http://www.site.org/training_book.asp?sInstance=1&EventID=139 301> http://www.site.org/clean-landing-url

but instead what is happening is this:

http://www.site.org/training_book.asp?sInstance=1&EventID=139 301> http://www.site.org/training_book.asp/?sInstance=1&EventID=139

It’s appending a forward slash just before the querystring, and then resolving the full URL (obviously, 404ing.)

What am I missing? Is it a regex issue with the actual %{QUERY_STRING} parameter?

Thanks in advance!

EDIT –

Here’s where I am so far.

Based upon the advice from @TerryE below, I’ve tried implementing the following rule.

I have a set of URLs with the following parameters:

http://www.example.org/training_book.asp?sInstance=1&EventID=139
http://www.example.org/training_book.asp?sInstance=2&EventID=256
http://www.example.org/training_book.asp?sInstance=5&EventID=188

etc.

which need to redirect to

http://www.example.org/en/clean-landing-url-one
http://www.example.org/en/clean-landing-url-two
http://www.example.org/en/clean-landing-url-three

etc.

This is the exact structure of the htaccess file I have currently, including the full examples of the "simple" redirects which are presently working fine (note – http://example.com > http://www.example.com redirects enforced in httpd.conf)

#301 match top level pages
RewriteCond %{HTTP_HOST} ^example\.org [NC]
RewriteRule ^/faq.asp /en/faqs/ [NC,R=301,L] 

All URLs in this block are of this type. All these URLs work perfectly.

#Redirect all old dead PDF links to English homepage.
RewriteRule ^/AR08-09.pdf /en/ [NC,R=301,L]

All URLs in this block are of this type. All these URLs work perfectly.

The problem is here: I still can’t get the URLs of the below type to redirect. Based upon advice from @TerryE, I attempted to change the syntax as below. The below block does not function correctly.

#301 event course pages
RewriteCond %{QUERY_STRING} sInstance=1EventID=139$
RewriteRule ^training_book\.asp$ /en/clean-landing-url-one? [NC,R=301,L]

The output of this is

http://staging.example.org/training_book.asp/?sInstance=1&EventID=139

(this is currently applying to staging.example.org, will apply to example.org)

(I had "hidden" some of the actual syntax by changing it to event_book from training_book in the initial question, but I’ve changed it back to be as real as possible.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:33:41+00:00Added an answer on June 7, 2026 at 11:33 pm

    The the documentation. QUERY_STRING contains the request content after the ?. Your condition regexp should never match. This makes more sense:

    RewriteCond %{QUERY_STRING}   ^sInstance=1&EventID=139$ 
    RewriteRule ^event_book\.asp$ /clean-landing-url/ [NC,R=301,L]
    

    The forward slash is caused by a different Apache filter (DirectorySlash).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just encountered very strange problem - my GWT app hosted on Google
I have encountered a very weird situation in Python. I have a while True:
We have encountered a very strange class not found problem in our web app
I have encountered a very strange issue. Whenever I use the .NET membership provider
For so many time, I have encountered problems with managing image having abnormally long
I have encountered a very strange problem in using jQuery load() . I used
I have encountered a very strange problem. The jquery slideshow in the below webpage
i have encountered a very strange issue: i use json.dump to write a file
I have encountered something very strange, simple WPF application <Window x:Class=ListBoxSelection.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow
I have encountered a very strange thing today : I have an app installed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.