Regex and mod_rewrite

I’m trying to figure out how to write the correct regular expression when the url has question marks inside.

The url:

The rewrite I have made but not working

RewriteRule ^s2=[A-Za-z0-9.-]+?lang=enb /subscription-confirmation/?lang=en [L,R=301]

Important that it looks for ?s2= and ?lang=en

I use mod_rewrite to do the redirect.

How do I match the regex so it actually matches similar to the one above?

Source: regex

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.