htaccess multiple rewrite rules for different GET variables
snippet in htaccess

htaccess multiple rewrite rules for different GET variables

user4843

Options +FollowSymLinks -indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /

## If the request is for a valid directory
RewriteCond %{REQUEST_FILENAME} -d [OR]
## If the request is for a valid file
RewriteCond %{REQUEST_FILENAME} -f [OR]
## If the request is for a valid link
RewriteCond %{REQUEST_FILENAME} -l
## don't do anything
RewriteRule ^ - [L]


RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$ ?x=$1&z=$2&y=$3&r=$4 [L,QSA]

RewriteRule ^([^/]+)/([^/]+)/([^/]+)/?$ ?x=$1&z=$2&y=$3 [L,QSA]

RewriteRule ^([^/]+)/([^/]+)/?$ ?x=$1&z=$2 [L,QSA]

RewriteRule ^([^/]+)/?$ ?x=$1 [L,QSA]

</IfModule>