Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: RewriteCond Using OR (or expression) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
RisingFromAshes
Newbie
Newbie


Joined: 09 January 2010
Online Status: Offline
Posts: 7
Posted: 10 January 2010 at 5:02pm | IP Logged Quote RisingFromAshes

Hello,
I've hit a roadblock and need some help, please.  Some time ago, I created two versions
of the same thing but did not clean up my mess. Now, I want to clean it up.

The following two requests go to the same place:
http://www.example.com?brand_nbr=2898
and
http://www.example.com?BrandNbr=2898

I have unsuccessfully tried the following RewriteCond rules to test EITHER one
for a TRUE condition.

Does not work
RewriteCond %{QUERY_STRING} ^BrandNbr=(\d+)$ [OR]
RewriteCond %{QUERY_STRING} ^brand_nbr=(\d+)$

Does not work
RewriteCond %{QUERY_STRING} ^BrandNbr|brand_nbr=(\d+)$

Does not work
RewriteCond %{QUERY_STRING} ^(BrandNbr|brand_nbr)=(\d+)$

Does not work
RewriteCond %{QUERY_STRING} ^(?:BrandNbr|brand_nbr)=(\d+)$

Does not work
RewriteCond %{QUERY_STRING} ^(?:BrandNbr|brand_nbr)=(\d+)$ [NC]

Does not work
RewriteCond %{QUERY_STRING} ^((?:BrandNbr|brand_nbr)=(\d+))$ [NC]

does not work
RewriteCond %{QUERY_STRING} ^((?:BrandNbr|brand_nbr)=(\d+))?$ [NC]


What am I missing?  My preference is to use an expression and not OR.

Thank you in advance.

Back to Top View RisingFromAshes's Profile Search for other posts by RisingFromAshes
 
RisingFromAshes
Newbie
Newbie


Joined: 09 January 2010
Online Status: Offline
Posts: 7
Posted: 10 January 2010 at 5:11pm | IP Logged Quote RisingFromAshes

Sorry, the following supporting info would help!

ISAPI_Rewrite version 3.1.0.69

IIS/5.0

Error.log shows each attempt as Loaded successfully

rewrite.log has not been working since install 3 days ago. Not having a problem executing other rules. Yes, errorlog level 9 and debug are there.

Back to Top View RisingFromAshes's Profile Search for other posts by RisingFromAshes
 
Anton
Admin Group
Admin Group


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

Please consider using the following condition:

RewriteCond %{QUERY_STRING} ^(?:BrandNbr|brand_nbr)=(\d+)$ [NC]

If it doesn't help, please show the complete config you are using.
Provide the testing request you want to get working.
And make sure you have granted sufficient permissions for file creation in ISAPI_Rewrite installation folder.
If permissions are ok, create empty rewrite.log manually.

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


Joined: 09 January 2010
Online Status: Offline
Posts: 7
Posted: 12 January 2010 at 2:48pm | IP Logged Quote RisingFromAshes

Thank you Anton.

This worked but only after I manually uninstalled and re-installed ISAPI_Rewrite.dll in the global filter tab and did a restart of inetsrv.

The rewrite.log still does not show in the directory. The permission EVERYONE has Full Control for the folder. Upon original manual install, I deleted the rewrite.log thinking that it was easier than doing a select all and deleting prior testing. The .dll should be smart enough to recognize that the file is gone and to re-create it. I then manually created rewrite.log and still no records are written to it.

Except for the rewrite.log, all my rules are working fine.

Back to Top View RisingFromAshes's Profile Search for other posts by RisingFromAshes
 
Anton
Admin Group
Admin Group


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

Well, the problem with the log may be due to:
- insufficient permissions for folder/file
- logging directives written in .htaccess not httpd.conf
- rewrite.log file was deleted and cannot be recreated

I can't think of anything else. Please recheck the above and if it looks fine, it would be great to get terminal access to your server to try
and find the root of the issue.

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


Joined: 24 April 2010
Online Status: Offline
Posts: 19
Posted: 30 April 2010 at 7:54am | IP Logged Quote zbuser

Yes of course, sorry about that!

I got it to work with:

RewriteMap mapfile txt:mapfile.txt
RewriteMap revmapfile txt:revmapfile.txt
RewriteCond %{QUERY_STRING} (.+)
RewrtieCond ^(?:Store/Store_Products\.aspx)$
RewriteRule ^Store/Store_Products\.aspx$ ${mapfile:%1}? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ Store/Store_Products\.aspx?${revmapfile:$1} [NC,L]
RewriteCond %{QUERY_STRING} (.+)
RewrtieCond ^(?:Store/Store_ProductDetails\.aspx)$
RewriteRule ^Store/Store_ProductDetails\.aspx$ ${mapfile:%1}? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ Store/Store_ProductDetails\.aspx?${revmapfile:$1} [NC,L]

Please let me know if there is a more efficient way to write both rules. Thanks!

Back to Top View zbuser's Profile Search for other posts by zbuser
 
zbuser
Newbie
Newbie


Joined: 24 April 2010
Online Status: Offline
Posts: 19
Posted: 30 April 2010 at 7:55am | IP Logged Quote zbuser

*wrong forum*
Back to Top View zbuser's Profile Search for other posts by zbuser
 

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