Generating a redirect based upon a captured query string value on httpd

Solution Unverified - Updated -

Issue

  • I'm trying to capture a query string in a RewriteCond and generate a redirect based upon that value like below but it doesn't work:

    RewriteCond %{QUERY_STRING}    ^foo=(.*)$    [NC]
    RewriteRule ^/bar/index.html$   http://redirected.com/to/$1 [NE,R=301,L]
    

Environment

  • Red Hat Enterprise Linux (RHEL)
  • JBoss Enterprise Web Server (EWS)
    • Apache httpd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content