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

  • SEARCH
  • Home
  • 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 8210493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:05:15+00:00 2026-06-07T10:05:15+00:00

My client wants a query string munged (by changing % to A) on certain

  • 0

My client wants a query string munged (by changing % to A) on certain pages.

For example, I can remove the query string completely on the desired pages via:

RewriteCond %{QUERY_STRING} !="" 
RewriteCond %{REQUEST_URI} ^/SpecialPage(.*) 
RewriteRule ^(.*)$ /$1? [R=301,L] #remove query string

Here’s what I thought should remove % on the query string and replace with A but it’s not:

RewriteCond %{QUERY_STRING} ^(.*)\%(.*)$
RewriteCond %{REQUEST_URI} ^/SpecialPage(.*)
RewriteRule ^(.*)$ /$1?%1A%2  [L]

What am I doing wrong in this? I just can’t quite spot it. Thanks for the expert eyes!

  • 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-07T10:05:17+00:00Added an answer on June 7, 2026 at 10:05 am

    You’re real close.

    The problem here is that you’ve got a condition and the match of your rule should be together. Your backreference to the previous RewriteCond is broken because it’s for the REQUEST_URI and not the QUERY_STRING like you want.

    RewriteCond %{REQUEST_URI} ^/SpecialPage(.*)
    RewriteRule ^(.*)$ /$1?%1A%2  [L]
    

    Here, the %1 backreference matches the (.*) at the end of the /SpecialPage URI. The backreferences from your query string match gets lost, and that’s the ones you really want. You can combine the condition to match the REQUEST_URI with the regular expression pattern in the RewriteRule:

    RewriteCond %{QUERY_STRING} ^(.*)\%(.*)$
    RewriteRule ^SpecialPage(.*)$ /SpecialPage$1?%1A%2  [L]
    

    Here, the %1 and %2 backreferences correctly reference the query string and the SpecialPage condition in the URI is met by the regex pattern.

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

Sidebar

Related Questions

I'm developing a web app for which the client wants us to query their
As stated in http://www.boutell.com/newfaq/misc/urllength.html , HTTP query string have limited length. It can be
Client wants a button on the mobile web app that launches a QR code
Client wants to append a field with a literal increment based on a count.
Client wants to edit DotNetNuke skin and he is not a programmer, so I'm
My client wants their app to always show a WARNING screen when the application
A client wants to ensure that I cannot read sensitive data from their site,
A client wants a multilingual site with a CMS. Is there a Ruby on
A client wants to add functionality to a system that will distribute large files(~700mb)
A client wants to use Google Apps for employees but they want to offer

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.