Hello
I'm trying to replicate the configuration from Apache to Openlitespeed.
Every RewriteRule works fine but I can't replicate the RewriteMap directive on OLS.
Here a simple example
#################################
Configuration file vhost.conf
#################################
rewrite {
enable 1
autoLoadHtaccess 0
logLevel 9
map aree {
location txt:/usr/local/lsws/conf/vhosts/newsite/aree.txt
}
rules RewriteRule ^/?(it)/([^/?]+).html.*$ alloggi.php?lang=$1&aree=$\{aree:$2\} [L,NC]
}
#################################
#################################
Map file aree.txt
#################################
toscana 1
argentario 2
chianti 3
maremma 5
#################################
When I call
http://xxx.xxx.xxx.xxx/it/chianti.html
i see the following logs (logLevel 9)
2023-07-31 09:10:40.918909 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] Rule: Match '/it/chianti.html' with pattern '^/?(it)/(.*)\.html$', result: 3
2023-07-31 09:10:40.919270 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] Source URI: '/it/chianti.html' => Result URI: 'alloggi.php?lang=it&aree=${aree:chianti}'
2023-07-31 09:10:40.919391 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] replace current query string with 'lang=it&aree=${aree:chianti}'
2023-07-31 09:10:40.919503 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] Last Rule, stop!
The RewriteRule is found (result: 3) but I don't understand how to get the value in the areas.txt file...
the rule is replicated with
'lang=it&aree=${aree:chianti}'
when i would like to get
'lang=it&aree=3'
#################################
My configuration
#################################
Ubuntu 22.04.2 LTS
LiteSpeed/1.7.17 Open (BUILD built: Mon Jun 19 20:17:14 UTC 2023)
PHP 8.2
module versions
lsquic 3.2.0
modgzip 1.1
cache 1.64
mod_security 1.4
#################################
Thanks to anyone who can help me
I'm trying to replicate the configuration from Apache to Openlitespeed.
Every RewriteRule works fine but I can't replicate the RewriteMap directive on OLS.
Here a simple example
#################################
Configuration file vhost.conf
#################################
rewrite {
enable 1
autoLoadHtaccess 0
logLevel 9
map aree {
location txt:/usr/local/lsws/conf/vhosts/newsite/aree.txt
}
rules RewriteRule ^/?(it)/([^/?]+).html.*$ alloggi.php?lang=$1&aree=$\{aree:$2\} [L,NC]
}
#################################
#################################
Map file aree.txt
#################################
toscana 1
argentario 2
chianti 3
maremma 5
#################################
When I call
http://xxx.xxx.xxx.xxx/it/chianti.html
i see the following logs (logLevel 9)
2023-07-31 09:10:40.918909 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] Rule: Match '/it/chianti.html' with pattern '^/?(it)/(.*)\.html$', result: 3
2023-07-31 09:10:40.919270 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] Source URI: '/it/chianti.html' => Result URI: 'alloggi.php?lang=it&aree=${aree:chianti}'
2023-07-31 09:10:40.919391 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] replace current query string with 'lang=it&aree=${aree:chianti}'
2023-07-31 09:10:40.919503 [INFO] [33861] [xxx.xxx.xxx.xxx:yyyy#zzzzzzzzzzz] [REWRITE] Last Rule, stop!
The RewriteRule is found (result: 3) but I don't understand how to get the value in the areas.txt file...
the rule is replicated with
'lang=it&aree=${aree:chianti}'
when i would like to get
'lang=it&aree=3'
#################################
My configuration
#################################
Ubuntu 22.04.2 LTS
LiteSpeed/1.7.17 Open (BUILD built: Mon Jun 19 20:17:14 UTC 2023)
PHP 8.2
module versions
lsquic 3.2.0
modgzip 1.1
cache 1.64
mod_security 1.4
#################################
Thanks to anyone who can help me