.htaccess

RewriteRule ^activation-account/(.+)/login([a-zA-Z0-9_]+)$ web/index.php?r=registration/activation-register/activation&key_active=$1&key_login=$2 [L] 

Follow the link http: // myhost // activation-account / $ 2y $ 10 $ Xl40W / SKTOXYcxfCxGszr.9tbd // lNJSVJTpBh4umjWf / 9GNMSlJy / loginfiko

We catch a variable in php key_active

It returns: $ 2y $ 10 $ Xl40W / SKTOXYcxfCxGszr.9tbd / lNJSVJTpBh4umjWf / 9GNMSlJy

That is, on this interval 9tbd/l slash is removed and it should be like this 9tbd//l

2 answers 2

Here is the working version of the redirect for Apache:

 RewriteEngine On RewriteCond %{REQUEST_URI} ^/*activation-account/(.+)/login(\w+)$ RewriteRule .* web/index.php??r=registration/activation-register/activation&key_active=%1&key_login=%2 [L] 

In query variables, he has nothing against double slash.

UPD + my answer to the question: How to do everything at once in mod_rewrite?

    It seems to me that the problem is not in regular expression, but in how apache handles URLs, but rather in web standards.

    Relatively speaking, any amount of slashes is always read as one slash. For example, http: // myhost / activation-account http: // myhost // activation-account http: // myhost /// activation-account and http: // myhost //////////// activation -account is the path to the same page.

    The correct way to solve this problem is to use urlencode / urldecode or base64.

    • Here is the right way to use the parameters and not show off - Alexey Ten