I recently did an URL spring cleanup in the backend and I'm currently struggling with one of the .htaccess redirects.
What I'm trying to redirect is:
https://www.example.com/directory/?type=supplier&category=celebrant&sort=latest
which should go to:
https://www.example.com/suppliers/type/celebrant
I've ended up with this regex and tested it on https://technicalseo.com/tools/htaccess/ but for some reason, my LiteSpeed Enterprise server doesn't seem to like it (other regex work).
RewriteCond %{REQUEST_URI} ^\/directory/$ [C]
RewriteCond %{QUERY_STRING} type=supplier&category=([a-zA-Z0-9-_]*) [C]
RewriteRule ^/?(.*)$ /suppliers/type/%1 [L,QSD,R=301]
Any thoughts on why it doesn't work with the enterprise version of LiteSpeed?
Update:
I did enable debug logging as George Wang suggested and what I got is:
unknown rewrite condition flag while parsing: RewriteCond %{REQUEST_URI} ^/directory/$ [C]
Invalid rewrite condition while parsing: RewriteCond %{REQUEST_URI} ^/directory/$ [C]
unknown rewrite condition flag while parsing: RewriteCond %{QUERY_STRING} type=supplier&category=([a-zA-Z0-9-_]*) [C]
Invalid rewrite condition while parsing: RewriteCond %{QUERY_STRING} type=supplier&category=([a-zA-Z0-9-_]*) [C]
Ignored due to previous error while parsing: RewriteRule ^/?(.*)$ /wedding-suppliers/type/%1 [L,QSD,R=301]
Pretty vague for me :(