MSFN Forum: Apache URL Rewriter - QSA Flag Problem - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Apache URL Rewriter - QSA Flag Problem Rewrite rule is behaving oddly.. I suspect QSA flag is up to something Rate Topic: -----

#1 User is offline   skukstr 

  • Group: Members
  • Posts: 1
  • Joined: 08-May 09

  Posted 08 May 2009 - 01:00 PM

Hey folks,

First time poster here... looks like a great community! I'm having an issue with the Apache URL Rewriter module. The web app that I'm building needs URLs to be converted from this format:
/My.Class?Arg1=x&Arg2=y

To this format:
/index.php?Class=My.Class&Arg1=x&Arg2=y

My rewrite rule looks like this:
RewriteRule ^(.*)$ index.php?Class=$1 [QSA]

Now the odd part is, this actually works... but my PHP script ends up receiving two copies of the 'Class' argument. I had my PHP script print out the exact query string for analysis:
/index.php?Class=index.php&Class=My.Class&Arg1=x&Arg2=y

I'm absolutely baffled as to why the rewrite engine is appending another Class argument on to the URL... and why in the world it's equal to 'index.php'. All I can think is that maybe I misunderstood the functionality of QSA. Any ideas?

Thanks in advance!! :thumbup


#2 User is offline   ReDucTor 

  • Newbie
  • Group: Members
  • Posts: 36
  • Joined: 28-May 06

Posted 26 May 2009 - 11:41 PM

Try [L,QSA] for last then query string append

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy