Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Apache URL Rewriter - QSA Flag Problem

- - - - -

  • Please log in to reply
1 reply to this topic

#1
skukstr

skukstr
  • Member
  • 1 posts
  • Joined 08-May 09
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


How to remove advertisement from MSFN

#2
ReDucTor

ReDucTor

    Newbie

  • Member
  • 36 posts
  • Joined 28-May 06
Try [L,QSA] for last then query string append




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users