Apache 2.2.3 / mod_rewrite problem [FIXED / MY MISTAKE]

New to mod_rewrite? This is a good place to start.

Apache 2.2.3 / mod_rewrite problem [FIXED / MY MISTAKE]

Postby akerem » Tue Dec 19, 2006 12:55 am

Update: Problem was with my id generating page. Sorry.

Hi,

I have a strange problem with my mod_rewrite rules. I have a page that generates 32 character random session ids and uses them to redirect user to an url like this:

http://www.mysite.com/RANDOMSESSIONID/m ... hp?a=1&b=2

This url should be written to:

http://www.mysite.com/mypage.php?a=1&b= ... MSESSIONID

I have the following rule to accomplish this:

RewriteRule ([A-Z0-9]{32})/(.*) $2?$1 [L,NE,QSA]

But when the url is written, only the part before the "&" in the query string is used. So the url is written to:

http://www.mysite.com/mypage.php?a=1&se ... MSESSIONID

I have also tried only redirecting to the page using the query string like this to see what is going on:

RewriteRule ([A-Z0-9]{32})/(.*) $2?%{QUERY_STRING} [L,NE]

And this was the result:

http://www.mysite.com/mypage.php?a=1

Am I missing something here? Shouldn't %{QUERY_STRING} refer to a=1&b=2 ?
akerem
 
Posts: 1
Joined: Tue Dec 19, 2006 12:41 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 39 guests

cron