Condition on parameter value

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 2
Joined: 23 Apr 2012, 11:12

Condition on parameter value

23 Apr 2012, 11:17

Hi all

A/ Nice board !

B/ My question

RewriteRule /(\w+)/page-general-(\d+)_(\d+).html /404.html [I,L]

This rule should work ONLY if $2 > 0 (zero)

Eg. :
/fr/page-general-0_1234.html => no redirection
/fr/page-general-123_456.html => redirection to 404.html

Thx for help
Samish

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Condition on parameter value

23 Apr 2012, 11:58

A/ Thanks!

B/ Please try this:

RewriteRule /(?!.*-page-general-0_.*)\w+/page-general-\d+_\d+\.html /404.html [RP,L]

User avatar
Posts: 2
Joined: 23 Apr 2012, 11:12

Re: Condition on parameter value

25 Apr 2012, 08:21

Hi Anton

1/ THx seems to work with (no first - in **)

RewriteRule /(?!.*page-general-0_.*)\(w+)/page-general-(\d+)_(\d+)\.html /404.html [RP,L]

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 2 guests