Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Ignore parameters entered into a URL Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
goldmail
Newbie
Newbie


Joined: 19 August 2009
Online Status: Offline
Posts: 22
Posted: 14 May 2010 at 6:45pm | IP Logged Quote goldmail

We are running Windows 2003 with IIS6 and ISAPI Rewrite 2.0.  This is what is currently in the httpd.ini file

RewriteRule .*/([a-z,0-9]){12,12}/$ /default.aspx?gmid=$1 [I,L]
RewriteRule .*/([a-z,0-9]{12,12})$ /default.aspx?gmid=$1 [I,L]

What this does is look for a 12 character string after the '/' in the domain name.  If it URL matches, it will play what we call a GoldMail.  If it doesn't you get a custom 404 page that says "Sorry your GoldMail was not entered correctly".

We've now run into the issue where the customer will add parameters to the GoldMail for whatever reason.  What happens is that with the added parameters the string is no longer 12 characters and they get the custom 404 page.

Here is an example:

This works fine:  http://play.goldmail.com/6odg5x9vz4ep

This doesn't work: http://play.goldmail.com/6odg5x9vz4ep?utm_source=Test&utm_medium=Test&utm_campaign=Test

How can I rewrite it to ignore any parameters added to the URL?  For instance tell it to ignore the ? and everything after it?.  If that isn't possible, do you have another solution on how we can accomplish this?
Back to Top View goldmail's Profile Search for other posts by goldmail
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 17 May 2010 at 3:13am | IP Logged Quote Anton

Please try using the following config instead of the one above:

RewriteRule /([a-z,0-9]{12})(?:\?.*)?$ /default.aspx\?gmid=$1 [I,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