Htaccess url用2个vars重写

I'm having problems with my htaccess. I've got this url: www.mypage.com/search.php?region=EUW&summonerName=Summonername. And this in my .htaccess file:

RewriteRule ^(.*)/(.*)/ https://www.mypage.com/search.php?region=$1&summonerName=$2 [L]

When I try to go to www.mypage.com/EUW/Summonername it returns 404.

Of course I've searched a lot about htaccess url rewrite before make this thread but, nothing works. What's wrong with the code? Cheers.

Edit: I've found the way using: RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)/(.*)/?$ search?region=$1&summonerName=$2 Now I can do urls like https://www.mypage.com/text/text without problems, but I still having a problem. In my form from index.php it still redirecting to https://www.mypage.com/search.php?region=text&summonerName=text and I don't even don't know why. Some idea? Cheers Ladies and Gentlemans.

Try this :

RewriteRule ^(.*)\/(.*)$ /search.php?region=$1&summonerName=$2 [L]

I think your problem is the protocol. It looks like you're trying to internally rewrite https and I don't believe it will let you do that for security purposes. That's why it's probably still redirecting.

You should use relative paths. Try it this way and see if it works for you.

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/?$ /search.php?region=$1&summonerName=$2 [L]