You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2016/09/20 22:22:26 UTC

[Bug 60159] New: mod_rewrite rules not executed

https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

            Bug ID: 60159
           Summary: mod_rewrite rules not executed
           Product: Apache httpd-2
           Version: 2.4.17
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_rewrite
          Assignee: bugs@httpd.apache.org
          Reporter: star.shravan@gmail.com

Created attachment 34283
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34283&action=edit
conf

[First post, advise where needed.]

I have a server with the following structure:

- root/
    - api/
        - products/
            - index.php
    - include/
        ...
    - index.php

The server is setup to use a virtual host which "Include"s a seaparate .conf
file attached below. I can confirm that the conf file is read. But when the url
is http://example.com/api/products, it 404s. The log contains just these 2
lines:

[Tue Sep 20 22:19:13.066519 2016] [rewrite:trace2] [pid 6024:tid 1016]
mod_rewrite.c(476): [client x.x.x.x:28438] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958b8330/initial] init rewrite engine with
requested uri /api/products
[Tue Sep 20 22:19:13.066519 2016] [rewrite:trace1] [pid 6024:tid 1016]
mod_rewrite.c(476): [client x.x.x.x:28438] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958b8330/initial] pass through /api/products

i.e. the RewriteRules set for /api/products aren't even run.

The following questions were from a few days back when I was trying to get this
to work via .htaccess files. They might provide more clues to the issue.

https://stackoverflow.com/questions/39402343/mod-rewrites-in-nested-htaccess-causing-strange-404
https://serverfault.com/questions/802301/mod-rewrites-in-nested-htaccess-causing-strange-404
(A user here believes this is a bug with DirectorySlash)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

Shravan Rajinikanth <st...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

Shravan Rajinikanth <st...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from Shravan Rajinikanth <st...@gmail.com> ---
What would that include? Just the config files and server root? (Sure, I can
get this to you soon, but really, everything is already here.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

Shravan Rajinikanth <st...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #2 from Shravan Rajinikanth <st...@gmail.com> ---
Eric, calling an actually non-existant URL like "/api/produc" instead of
"/api/products" still gives me a 404, but a completely different log output
(below).

Further, removing the directory directive causes the index.php page to load
instead of 404'ing. 

[Wed Sep 21 01:28:33.978593 2016] [rewrite:trace2] [pid 6024:tid 1012]
mod_rewrite.c(476): [client x.x.x.x:31018] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958aa2c0/initial] init rewrite engine with
requested uri /api/produc
[Wed Sep 21 01:28:33.978593 2016] [rewrite:trace1] [pid 6024:tid 1012]
mod_rewrite.c(476): [client x.x.x.x:31018] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958aa2c0/initial] pass through /api/produc
[Wed Sep 21 01:28:33.978593 2016] [rewrite:trace3] [pid 6024:tid 1012]
mod_rewrite.c(476): [client x.x.x.x:31018] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958aa2c0/initial] [perdir
C:/Workbench/Webserver/example.com/api/] strip per-dir prefix:
C:/Workbench/Webserver/example.com/api/produc -> produc
[Wed Sep 21 01:28:33.978593 2016] [rewrite:trace3] [pid 6024:tid 1012]
mod_rewrite.c(476): [client x.x.x.x:31018] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958aa2c0/initial] [perdir
C:/Workbench/Webserver/example.com/api/] applying pattern '^(.+)(?<!/)$' to uri
'produc'
[Wed Sep 21 01:28:33.978593 2016] [rewrite:trace4] [pid 6024:tid 1012]
mod_rewrite.c(476): [client x.x.x.x:31018] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958aa2c0/initial] [perdir
C:/Workbench/Webserver/example.com/api/] RewriteCond:
input='C:/Workbench/Webserver/example.com/api/produc/' pattern='-d' =>
not-matched
[Wed Sep 21 01:28:33.978593 2016] [rewrite:trace1] [pid 6024:tid 1012]
mod_rewrite.c(476): [client x.x.x.x:31018] x.x.x.x - -
[example.com/sid#6595032cc8][rid#65958aa2c0/initial] [perdir
C:/Workbench/Webserver/example.com/api/] pass through
C:/Workbench/Webserver/example.com/api/produc

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #1 from Eric Covener <co...@gmail.com> ---
Convince me those <Directory> sections match at all.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

Shravan Rajinikanth <st...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #7 from Shravan Rajinikanth <st...@gmail.com> ---
I have posted the test case after cleaning up as much as I could. I was able to
isolate that the "RewriteEngine On" line is causing the issue and indicated it.
You can see this by commenting out the one line.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

--- Comment #6 from Shravan Rajinikanth <st...@gmail.com> ---
Created attachment 34285
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34285&action=edit
testcase

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #5 from Eric Covener <co...@gmail.com> ---
(In reply to Shravan Rajinikanth from comment #4)
> What would that include? Just the config files and server root? (Sure, I can
> get this to you soon, but really, everything is already here.)

A single, minimal config file you can pass to apachectl -f that demonstrates
the problem +  small zip of the documentroot it references.  

I'm not doubting that it fails for you, but I won't be able to keep trying
different permutations of all the unspecified stuff to do anything here without
it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 60159] mod_rewrite rules not executed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60159

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Eric Covener <co...@gmail.com> ---
Will need a complete, minimal self-contained test case to get anywhere with
this as a bug report.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org