You've got a couple problems. $0
is the entire match, you want $1
referencing the first submatch, the (.*)
. Like so:
url.rewrite-once = (
"^/Folder/(.*)" => "/Folder/index.php?baseURL=$1"
)
This still has a problem with the query string, it'll produce two ?
s. E.g.
"/Folder/foo?bar=1" => "/Folder/index.php?baseURL=foo?bar=1"
Final solution:
url.rewrite-once = (
# Match when there are no query variables
"^/Folder/([^\?]*)$" => "/Folder/index.php?baseURL=$1",
# Match query variables and append with &
"^/Folder/([^\?]*)\?(.*)$" => "/Folder/index.php?baseURL=$1&$2",
)