&PHPSESSID not ?PHPSESSID for mod rewrited URLs

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
jggretton
Forum Newbie
Posts: 8
Joined: Fri Sep 15, 2006 7:14 am

&PHPSESSID not ?PHPSESSID for mod rewrited URLs

Post by jggretton »

Hello all, I've having a really frustrating problem with PHPSESSID

All my pages have mod rewrite ie:

Code: Select all

http://www.mydomain.com/products/ => http://www.mydomain.com/index.php?page1=products
Recently I've been having many problems with non cookie enabled users, i enabled session.use_trans_sid (for non spiders). Now:

Code: Select all

http://www.mydomain.com/products/?PHPSESSID=sjdhf89sfd8 => http://www.mydomain.com/?page1=products?PHPSESSID=sjdhf89sfd8
But it obviously needs to go to:

Code: Select all

http://www.mydomain.com/?page1=products&PHPSESSID=sjdhf89sfd8
instead.

Any suggestions?

Thanks a lot,

James
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post by miro_igov »

you can just do regexp on PHPSESSID=

There is no matter in what position you will place it in the GET tier
jggretton
Forum Newbie
Posts: 8
Joined: Fri Sep 15, 2006 7:14 am

Post by jggretton »

Do you mean do a reg expression in htaccess to replace ?PHPSESSID with &PHPSESSID ?

I'll give it a go - I have to admit i'm not sure how to do this though!
jggretton
Forum Newbie
Posts: 8
Joined: Fri Sep 15, 2006 7:14 am

Post by jggretton »

Update:

I've been trying this:

Code: Select all

RewriteRule ^(.*)\?PHPSESSID(.*)$ /$1&PHPSESSID$2 [L]
But no luck. The question mark symbol '?' seems to be causing the problems...
Post Reply