apache - Chaining/Combining query strings in .htaccess. Is this possible? -


is possible chain or combine query strings when writing rewritecond or rewriterules?

at moment have in .htaccess file…

rewritecond %{query_string} tiger [or] rewritecond %{request_uri} tiger rewriterule ^ http://www.example.com/news/? [l,r=301]  rewritecond %{query_string} lion [or] rewritecond %{request_uri} lion rewriterule ^ http://www.example.com/news/? [l,r=301]  rewritecond %{query_string} cheetah [or] rewritecond %{request_uri} cheetah rewriterule ^ http://www.example.com/news/? [l,r=301] 

all 3 matches going same destination. possible or need keep them separate lines?

rewritecond %{query_string} (tiger, lion, cheetah) [or] rewritecond %{request_uri} (tiger, lion, cheetah) rewriterule ^ http://www.example.com/news/? [l,r=301] 

here htaccess file is…

rewriteengine on  rewritecond %{http_host} ^example.com rewriterule (.*) http://www.example.com/$1 [r=301,l]  rewritebase / rewriterule ^index\.php$ - [l]  # add trailing slash /wp-admin rewriterule ^([_0-9a-za-z-]+/)?wp-admin$ $1wp-admin/ [r=301,l]  rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] rewriterule ^([_0-9a-za-z-]+/)?(wp-(content|admin|includes).*) $2 [l] rewriterule ^([_0-9a-za-z-]+/)?(.*\.php)$ $2 [l] rewriterule . index.php [l] 

you can use regex alternation:

rewritecond %{query_string} (tiger|lion|cheetah) [nc,or] rewritecond %{request_uri} (tiger|lion|cheetah) [nc] rewriterule ^ http://www.example.com/news/? [l,r=301] 

Comments