This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
LinkFreeze (Forum Locked Forum Locked)
 Helicon Tech : LinkFreeze
Subject Topic: Exclude pages with a specific querystring (Topic Closed Topic Closed)
Author
Message |
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 01 September 2008 at 6:04am  

Hello,

I need to exclude from rewrite urls that contains a specific querystring parameter, for exemple :

test.asp?value=1 have to be rewrite to test~value~1.htm
To do it I use this rule: /    ~~~    .asp    [MoveExt,Redirect]

But test.asp?utm_source=1 ==> no rewrite
I tried a rule like that :
@/(?![.]*utm[.]*).*    ~~~    .asp    [MoveExt,Redirect]

but it dosen't works...

I need this to be able to use some functions of Google Analytics (Campaign Tracking), because GA use a javascript to parse the url with "?" and "=" if urls are rewrited GA loose campaign parameters and cannot put it into the cookie...

Thanks for your quick help, best regards.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 01 September 2008 at 9:24am  

If it is possible please try to change those links to absolute format.

Or (if the first solution doesn't suit you) try the following rule:

@/(?!.*utm.*).*    ~~~    .asp  @(?!.*utm).*  [MoveExt,Redirect]


__________________
Regards,
Anton
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 01 September 2008 at 9:40am  

Thanks a lot for your answer. I cannot change links to absolute format because otherwhis Google Analytics can't get the querystring values (GA needs ? & and = in the url to parse it)...

I put your rule but when I try to access test.asp?utm_source=1 I got a 404 error now...
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 01 September 2008 at 9:57am  

and the url is still rewrited to test~utm~1.htm I need it stay test.asp?utm=1
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 03 September 2008 at 5:14am  

Can you please provide examples of the links you want to exclude and we'll try to provide you the working rule.

__________________
Regards,
Anton
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 03 September 2008 at 6:03am  

In fact the problem is "Redirect". I need to keep function "Redirect old style requests" active for the whole website except when someone access with a special URL that contains "&utm_source=" :

http://www.monsite.com/test.asp?value1=a&value2=b
Have to be redirected to test~value1~a~value2~b.htm

http://www.monsite.com/test.asp?value1=a&value2=b&utm_source=google
Have not to be redirected, stay like that with "?" and "&" and "=".

So it's not a problem with link rewriting but with direct request and redirect function...

It strange but Google Analytics cannot retrieve some information if querystring don't use "normal" separator...

Thanks for your help and great job, best regards. I stay here and can test directly your suggestions.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 04 September 2008 at 7:47am  

Unfortunately LinkFreeze is unable to check querystring for presence of "utm" and therefore the rule is always
executed.
But you may try to remove Redirect flag from LinkFreeze and use redirect functionality of ISAPI_Rewrite (even
Lite free version is suitable). If this solution suits you, we may provide ISAPI_Rewrite rule for you.

__________________
Regards,
Anton
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 09 September 2008 at 6:46am  

Thanks for your help.

I installed ISAPI Rewrite Lite on my server, what I have to do now ?

My current Rule for Link Freeze is :
/        ~~~    .asp        [MoveExt,Redirect,Lowercase]

Thanks for your answer, best regards.
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 11 September 2008 at 8:51am  

How to use ISAPI_Rewrite ?

- My server is an IIS 6 on Windows Server 2003
- I installed ISAPI Rewrite Lite
- I add Isapi Filter on my website name: ISAPI_Rewrite file: ISAPI_Rewrite.dll

But now what I have to do to make it active ? I try to use Helicon Manager but nothing happens, please help me.
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 12 September 2008 at 6:01am  

ok now ISAP Rewrite works fine. I just need to know the rule to put into ISAPI and into LinkFreeze to do what I need as explain before.Thanks
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 15 September 2008 at 5:36am  

Please add the following lines into the .htaccess file in the root of your site:

#skip all requests with utm
RewriteCond %{QUERY_STRING} utm [NC]
RewriteRule .? - [L]

#redirect non-utm requests to frozen links
RewriteCond %{QUERY_STRING} ([^&=]+)=([^&=]+)(.*)
RewriteRule (.*) $1~%1~%2\?%3 [LP,C]
RewriteRule ([^.]+)\.asp(.*) $1$2.htm [R=301, L, NC]


And your rule in LinkFreeze should be:
/        ~~~    .asp @(?!.*utm).*      [MoveExt,Lowercase]


__________________
Regards,
Anton
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 15 September 2008 at 1:03pm  

Thanks a lot for your solution, it works great, just one problem :

Empty values in query parameters are now discarded, for exemple :
test.asp?value1=a&value2=&value3=c
is rewritten to : test~value1~a~value2~value3~c.htm
in place of test~value1~a~value2~~value3~c.htm

--> I need to keep value2 = empty "~~" and not value2 = "value3" you understand...

Thanks for your help.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 17 September 2008 at 4:21am  

Please try to fix the config in the following way:

#skip all requests with utm
RewriteCond %{QUERY_STRING} utm [NC]
RewriteRule .? - [L]

#redirect non-utm requests to frozen links
RewriteCond %{QUERY_STRING} ([^&=]+)=([^&=]*?)(.*)
RewriteRule (.*) $1~%1~%2\?%3 [LP,C]
RewriteRule ([^.]+)\.asp(.*) $1$2.htm [R=301, L, NC]

__________________
Regards,
Anton
Back to Top
 
market-ds
Newbie


Joined: 01 September 2008
Posts: 9
Posted: 17 September 2008 at 9:52am  

I try your rule and now it rewrites like that :

/test.asp?value1=a&value2=&value3=c
is rewritten to :
/test~value1~~value2~~value3~.htm?c

Thanks for your help I'm sure we will be successful in a few time
Back to Top
 

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