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

Solution Unverified - Updated -


  • 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$$1 [NE,R=301,L]


  • 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