htaccess: rewrite query string to path


I have a domain with the following query string:

My objective is to convert this query string after ?taxo= into a path based on the values for each parameter like so:

Using .htaccess, this is what I've tried:

RewriteCond %{QUERY_STRING}
RewriteRule ^taxo=(.*)&(.*)=(.*)&(.*)=(.*)&(.*)=(.*)$  $1/$2/$3/$4/$5/$6/$7 [L,R=301]

However, that doesn't work for me. I'm trying to understand where I am going wrong with the RewriteRule line since the condition isn't being met.


You cannot match query string in a RewriteRule. You should use QUERY_STRING variable in a RewriteCond to match and capture value from query string:

RewriteEngine On

RewriteCond %{QUERY_STRING} ^taxo=([^&]+)&([^=]+)=([^&]+)&([^=]+)=([^&]+)&([^=]+)=(.*)$ [NC]
RewriteRule ^/?$ /%1/%2/%3/%4/%5/%6/%7? [L,R=301]
  • Note that you will need to use %N syntax for back-reference of values captured in RewriteCond.
  • ? at the end of the target URI is to strip off previous query string.
By : anubhava

try something like this.

You need the variable accessible in both functions so it needs to be declared outside those functions and then defined inside the first one and use clearInterval() to cancel an existing interval

var timer;
$('#name').mouseenter(function() {
   timer = setInterval(mosaic, 150);
}).mouseleave(function() {

This video can help you solving your question :)
By: admin