Thank you, I've tested the 1.2.2 and works.
I've made an extra test and I noticed that, if I set a php as index file, it avoid the script_name rule. Shouldn't the SCRIPT_NAME (or SCRIPT_FILENAME) even when the file is the index file of a directory?
In my use case isn't usefull, but with other...
RewriteCond %{SCRIPT_NAME} \.php$
RewriteRule /(.*)$ /notexist.html [L,R=404]
Doesn't work under 1.0.4:
using SCRIPT_NAME:
http://www.example.com/foo.php pass (no cond line in the log)
http://www.example.com/foo.php/bar is blocked
http://www.example.com/foo.php?bar pass (no cond line in the...
So, it's a bug:
2013-07-10 10:42:23.750 [INFO] [] [REWRITE] Rule: Match '/index.php/foo' with pattern '/.*', result: 1
2013-07-10 10:42:23.750 [INFO] [] [REWRITE] Cond: Match '/var/www/some/path/htdocs/index.php/foo' with pattern '\.php$', result: -1
and here it stop.
using those rules...
I don't speak fluently c++; also, as I suppose that is a bug, I'd like to report it.
Thank you, I'll make a patch for my packaged version.
edit:
Your fix doesn't hide the server header: sv is passed to HttpServerVersion::hideDetail but hideDetail only check if is 0 or not 0.
I've made a patch...
Hello,
in openlitespeed 1.0.4, if I select to "Hide full header" in the server signature setting, i get this warning in the log file:
[WARN] [config:server:basic] invalid value of <showVersionNumber>:2, use default=0
Regards,
Stefano
Thanks, nearly perfect. Doesn't still pass one precondition: "if foo.php is a file".
I tried to add a -f, but I don't understand the OR / AND precedence.
I think that I should do something like this:
A) RewriteCond %{REQUEST_FILENAME} -f
B) RewriteCond %{REQUEST_FILENAME} \.php$
C) RewriteCond...
Excuse me, but my example wasn't ending in php; that's the difference (i suppose).
My use case, actually, is:
To block (if foo.php is a file)
http://www.example.com/foo.php
http://www.example.com/foo.php/bar
http://www.example.com/bar.php/foo.php
http://www.example.com/foo.php?/bar...
I don't know how much openlitespeed changed from v1.0.4 to v1.2, but with your rewrite rule an url like http://www.example.com/index.php?/foo showed to me the php file (instead of 404).
Maybe I miss some points.
Hello, I'm having some trouble in a simple (at least I think so) rewrite rule: I want to return 404 for all php files.
But I should also take in care that they can have a path info (so something like http://www.example.com/foo.php/bar) or that a path can have .php (e.g...