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 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Trailing URL params messing up my rules
Author
Message |
fenrir
Newbie


Joined: 31 July 2011
Location: Australia
Posts: 3
Posted: 31 July 2011 at 10:35pm

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 Visit fenrir's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 01 August 2011 at 12:56am

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
 
fenrir
Newbie


Joined: 31 July 2011
Location: Australia
Posts: 3
Posted: 01 August 2011 at 5:55am

Brilliant thanks Anton!
Back to Top Visit fenrir's Homepage
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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