I have next lines in a htaccess file:
RewriteCond %{QUERY_STRING} (^|&)grp=([0-9]+)(&|$)
RewriteCond %{QUERY_STRING} (^|&)level=([0-9]+)(&|$)
RewriteRule ^alpe-adria/([a-zA-Z0-9_-]+)$ /site/index.php?d=1&box=1&grp=%1&grpname=$1&level=%2 [L]
The original URL has this code:
/site/index.php?d=1&box=1&grp=13&grpname=art-culture&level=1
The parameters d and box are fixed, other parameters grp, grpname and level are varying from page to page. What I want to do is to rewrite this URL into such state:
/alpe-adria/art-culture
So the problem is, how to single out grpname parameter and also use all other parameters, from which two are not fixed. I tried two RewriteCond %{QUERY_STRING} rules with no success. Idea is to single out two parameters and then use them in original URL. In other hand one parameter is used in original URL as in substitute URL. Again, I'm stuck and I need your precious help.
Whole snippet:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{QUERY_STRING} box=
RewriteRule ^alpe-adria$ /site/index.php [L]
RewriteCond %{QUERY_STRING} d=
RewriteRule ^alpe-adria$ /site/index.php [L]
RewriteCond %{QUERY_STRING} op=
RewriteRule ^alpe-adria$ /site/index.php [L]
RewriteCond %{QUERY_STRING} masterSearch=
RewriteRule ^alpe-adria$ /site/index.php [L]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^alpe-adria/?$ /site/index.php?box=1&d=3 [L]
RewriteCond %{QUERY_STRING} (?:|.*&)grpname=([^&]*)
RewriteRule ^site/index\.php$ /alpe-adria/%1? [L,R]