RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1210091 - mod_rewrite bug - not actually rewriting
Summary: mod_rewrite bug - not actually rewriting
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: httpd
Version: 7.1
Hardware: All
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: Martin Frodl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-08 22:09 UTC by mcin
Modified: 2021-01-14 09:33 UTC (History)
4 users (show)

Fixed In Version: httpd-2.4.6-32.el7
Doc Type: Bug Fix
Doc Text:
Cause: mod_dir did not ignore the request even when it has been already handled by mod_rewrite. Consequence: mod_dir could override mod_rewrite when handlign the request for a directory because of DirectoryIndex setting. Fix: mod_dir now ignores the request when it has been handled by mod_rewrite already. Result: mod_dir no longer overrides mod_rewrite when handling requests.
Clone Of:
Environment:
Last Closed: 2015-11-19 04:37:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache Bugzilla 53929 0 None None None Never
Red Hat Product Errata RHBA-2015:2194 0 normal SHIPPED_LIVE httpd bug fix and enhancement update 2015-11-19 08:05:27 UTC

Description mcin 2015-04-08 22:09:17 UTC
mod_rewrite bug that was fixed in apache 2.4.9 over a year ago is still present in 2.4.6 version of httpd included in RHEL 7.1
this is a serious bug, because it makes setting mod_rewrite rules in .htaccess impossible, although they were easy to setup in apache<2.4

steps to reproduce:

set a rule in .htaccess file like

RewriteRule ^(.*)$ index.php?page=$1 [L]

the request for '/Anything' should be rewritten to '/index.php?page=Anything', but is not

it's described in apache's bugzilla https://bz.apache.org/bugzilla/show_bug.cgi?id=53929

I'm not sure if 1180745 covers this bug too.

Comment 5 Jan Kaluža 2015-07-01 09:21:57 UTC
(In reply to mcin from comment #0)
> mod_rewrite bug that was fixed in apache 2.4.9 over a year ago is still
> present in 2.4.6 version of httpd included in RHEL 7.1
> this is a serious bug, because it makes setting mod_rewrite rules in
> .htaccess impossible, although they were easy to setup in apache<2.4
> 
> steps to reproduce:
> 
> set a rule in .htaccess file like
> 
> RewriteRule ^(.*)$ index.php?page=$1 [L]
> 
> the request for '/Anything' should be rewritten to
> '/index.php?page=Anything', but is not
> 
> it's described in apache's bugzilla
> https://bz.apache.org/bugzilla/show_bug.cgi?id=53929
> 
> I'm not sure if 1180745 covers this bug too.

Hi,

it's clear what's the issue in the upstream bug report #53929, but I'm struggling to understand your reproducer.

Just "RewriteRule ^(.*)$ index.php?page=$1 [L]" won't do what you are describing even in httpd-2.2.x imho.

It rewrites "/Anything" to "index.php?page=/Anything", but then the internal redirect happens to index.php, rewrite rule applies again and in the end you will get "index.php?page=index.php".

The upstream bug report we are going to fix in RHEL-7.2 is about RewriteRule matching the same file as DirectoryIndex (for example "index.php" or "index.html").

I presume you are hitting this issue, but you haven't provided full configuration. Is that the case?

Comment 6 mcin 2015-07-04 04:48:51 UTC
Hi, that's correct, I didn't provide full contents of .htaccess, sorry for that.
The redirect won't work without RewriteCond lines as below (it's actually full contents of .htaccess that does the trick on 2.2, but not on 2.4)

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/?page=$1 [L]

Comment 9 errata-xmlrpc 2015-11-19 04:37:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2194.html


Note You need to log in before you can comment on or make changes to this bug.