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.

How I can chain those rule as "( A and B ) or C"? The only way is to do "(A or C ) and ( B or C )"?

---

While ${SCRIPT_NAME} trim out the path info and give to me the ${SCRIPT_NAME} related to the www root, I noticed that ${SCRIPT_FILENAME} doesn't trim out the path info; actually, seems to me, that act like ${REQUEST_FILENAME}.

working perfectly under 4.2.3 (you can try 4.2.3 standard version if possible)
it seems open ls 1.0.4 or 1.2 just don't understand %{SCRIPT_NAME} in RewriteCond.

that can explain the test result on open ls 1.x

I'll submit bugs found from this thread.

Click to expand...

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 rewrite rule can be mandatory.