Can i use RewriteRule inside Location and Files sections in Apache httpd?

Solution Verified - Updated -

Issue

  • Does RewriteRule is permitted in <Location> and <Files> sections in Apache httpd?
  • When i use the simple RewriteRule as follows in <Location> sections it doesn't work, and when used the same inside <Directory>, it works fine. Why?
<Location "/">
RewriteEngine On
LogLevel info rewrite:trace4
RewriteRule ^/foo/(.*)$  /$1 [P,L]
</Location>

Environment

  • Red Hat JBoss Web Server (JWS) 3.0.3
    • Apache httpd 2.4.6

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