vendredi 31 juillet 2015

Rewrite with if and else

i have to add if and else to my rewrite rule.

My rewrite is this

  RewriteCond %{THE_REQUEST} \ /+catalogsearch/result/\?cat=(.*)&q=([^&\ ]+)
RewriteRule ^ /q_%2_cat_%1? [L,NE,R=301]
RewriteRule ^q_(.*)_cat_(.*)?$ /http://ift.tt/1JVzBHk [QSA,P,NC]

and i would like to change to this if cat is in null

RewriteCond %{THE_REQUEST} \ /+catalogsearch/result/\?cat=&q=([^&\ ]+)
RewriteRule ^ /q_%1? [L,NE,R=301]
RewriteRule ^q_(.*)$ /http://ift.tt/1KDWN2L [QSA,P,NC]

Is it possible? Thanks in advance

Aucun commentaire:

Enregistrer un commentaire