Created attachment 34283 [details] 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)
Convince me those <Directory> sections match at all.
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
Will need a complete, minimal self-contained test case to get anywhere with this as a bug report.
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.)
(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.
Created attachment 34285 [details] testcase
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.