This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Trailing URL params messing up my rules Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
fenrir
Newbie
Newbie


Joined: 31 July 2011
Location: Australia
Online Status: Offline
Posts: 3
Posted: 31 July 2011 at 10:35pm | IP Logged Quote fenrir

Have just started working for a company that using ISAPI_Rewrite2 extensively across 80+ websites and have found that there is an issue with URL params appended from eMarketing programs and google
adwords that causes 404 errors to be thrown.

The standard set of rules at the base of the httpd.ini in every site looks like this:

# Site-wide rules for 3 CMS page levels deep
RewriteRule /     /index.cfm     [I,U,L]
RewriteRule /([\w-]+)/     /index.cfm\?page=$1     [I,U,L]
RewriteRule /([\w-]+)/([\w-]+)/     /index.cfm\?page=$1\&subpage=$2     [I,U,L]
RewriteRule /([\w-]+)/([\w-]+)/([\w-]+)/     /index.cfm\?page=$1\&subpage=$2\&subsubpage=$3     [I,U,L]

This works without issue for each level of nesting, however once google appends params after the trailing "/" it will throw a 404.

ie www.domain.com.au/page1/page2/?g=122r23r2

I just want to ignore the any url params at any level of the directory structure if possible.

Any help would be greatly appreciated.

Cheers
Phil
Back to Top View fenrir's Profile Search for other posts by fenrir Visit fenrir's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 01 August 2011 at 12:56am | IP Logged Quote Anton

Please try to modify the config as follows:

RewriteRule /(?:\?g=.*)?     /index.cfm     [I,U,L]
RewriteRule /([\w-]+)/(?:\?g=.*)?     /index.cfm\?page=$1     [I,U,L]
RewriteRule /([\w-]+)/([\w-]+)/(?:\?g=.*)?     /index.cfm\?page=$1\&subpage=$2     [I,U,L]
RewriteRule /([\w-]+)/([\w-]+)/([\w-]+)/(?:\?g=.*)?     /index.cfm\?page=$1\&subpage=$2\&subsubpage=$3     [I,U,L]

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


Joined: 31 July 2011
Location: Australia
Online Status: Offline
Posts: 3
Posted: 01 August 2011 at 5:55am | IP Logged Quote fenrir

Brilliant thanks Anton!
Back to Top View fenrir's Profile Search for other posts by fenrir Visit fenrir's Homepage
 

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