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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.