Page 1 of 1

&PHPSESSID not ?PHPSESSID for mod rewrited URLs

Posted: Fri Nov 10, 2006 5:04 am
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

Posted: Fri Nov 10, 2006 5:30 am
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

Posted: Fri Nov 10, 2006 6:15 am
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!

Posted: Fri Nov 10, 2006 6:34 am
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...