Apply QSA Flag Rewrite Rule to all existing rules

Discussion in 'Apache' started by nehalall, Dec 20, 2012.

  1. #1
    I will first explain the current configuration:If I go the URL: www.website.com/catalogue/item/xyzThe server redirects me to - www.website.com/catalogue/itemdetail.do?id=xyzThis is achieved using the following rule in apache configuration file used for the project included in httpd.conf:RewriteRule ^/catalogue/item/(.*)$ /catalogue/itemdetail.do?id=$1 [NE,NC,P,L]There are several other rules for making similar redirects likeRewriteRule ^/catalogue/module/(.*)$ /catalogue/module.do?id=$1 [NC,P,L]RewriteRule ^/(.*)/flx/(.*)$ /flexi.do/$1/$2 [NC,P]RewriteRule ^/(.*)/flx0/(.*)$ /flexi0.do/$1/$2 [NC,P]and so on.........................I want to allow to append query string at the end of each every URL if its called that way. For exampleThis link www.website.com/catalogue/item/xyz?var1=val1&var2=val2Should be redirected to the link: www.website.com/catalogue/itemdetail.do?id=xyz&var1=val1&var2=val2So if I change my redirects to:RewriteRule ^/catalogue/item/(.*)$ /catalogue/itemdetail.do?id=$1 [NE,NC,P,L,QSA]RewriteRule ^/catalogue/module/(.*)$ /catalogue/module.do?id=$1 [NC,P,L,QSA]and so on...I am able to achieve that. Now my question is:Is there a way to achieve this same outcome (as using 'QSA') with a global setting such that it is applied to all the redirects in the cofiguration file so that I don't have to apply it to every redirect individually?RegardsNeha
     
    nehalall, Dec 20, 2012 IP