Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: not working with querystring and subdomai Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
arof3000
Newbie
Newbie


Joined: 14 June 2010
Online Status: Offline
Posts: 2
Posted: 14 June 2010 at 2:37pm | IP Logged Quote arof3000

I have my httpd.ini with following rules:

[ISAPI_Rewrite]
RewriteCond Host: (?:www\.)mysite.com
RewriteRule (.*) $1 [I,O,L]

RewriteCond Host: (.*)\.mysite.com
RewriteRule (.*) $2\?account=$1 [I,O,L]


------------

when user enter subdomain1.mysite.com/page.aspx, I expect
to have

mysite.com/page.aspx?account=subdomain1

it is working fine and I'm happy!

the problem is happening when user browser navigates to
follwoing url:

subdomain1.mysite.com/page.aspx?somedata=someinfo

and the filter is rewriting to:

mysite.com/page.aspx?somedata=someinfo?account=subdomain1

when the correct should be

mysite.com/page.aspx?somedata=someinfo&account=subdomain1

is there any solution for this problem??
Back to Top View arof3000's Profile Search for other posts by arof3000
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 15 June 2010 at 5:57am | IP Logged Quote Anton

Please try to fix your config like this:

[ISAPI_Rewrite]
RewriteCond Host: www\.mysite\.com
RewriteRule .* $0 [I,L]

RewriteCond Host: (?!www\..*)([^.]+)\.mysite\.com
RewriteRule (.*?)(?:\?(.+))? $2\?account=$1(?3&$3) [I,O,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum