tags:

views:

29

answers:

1
+1  Q: 

Mod Rewrite issue

I have a huge .htaccess file, with a lot of rewrites. i want to make a modification, that will affect every rewrite.

Let's say I have

RewriteRule ^(.*)/(.*)-([0-9]+).html$ request.php?id=$3&txt=$2&cat=$1

If i will have www.mysite.com/magic/info-212.html?condition=1 i will want to add to request.php that condition=1, but i can have anything after ? (eg: add=magic, kill=php)

I don't want to modify all the rewrites for something that may be or not be added.

+2  A: 

Maybe the QSA (query string append) flag is what your looking for.

RewriteRule ^(.*)/(.*)-([0-9]+).html$ request.php?id=$3&txt=$2&cat=$1 [QSA]

This would rewrite www.mysite.com/magic/info-212.html?condition=1 to www.mysite.com/request.php?id=212&txt=info&cat=magic&condition=1.

Philippe Gerber
thank you. saved me :D
Mihai Iorga