Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Rules work on one site, not on another Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
cleo-marc
Newbie
Newbie


Joined: 03 July 2008
Location: United Kingdom
Online Status: Offline
Posts: 14
Posted: 17 July 2008 at 10:57am | IP Logged Quote cleo-marc

I have two sites with identical rules, apart from the VDir and category:

RewriteRule products/(.*)/(.*)\.[htm|html] /vDir/default.asp?category=category&service=ec-frame&opt=subcat&ct=$1&subcat=$2 [I,L,QSA]

One works as expected, the other doesn't.  From the log, the one that fails is not matching the rule.

This one works:

http://www.yournewshop.co.uk/products/clocks/mantel.html

Log says:

(2) init rewrite engine with requested uri /products/clocks/wall.html
(1) Htaccess process request
(1) Htaccess process request d:\inetpub\wwwroot\ecommerce\website\.htaccess
(3) applying pattern 'products/(.*)/(.*)\.[htm|html]' to uri 'products/clocks/wall.html'
(1) escaping /ec-user/default.asp?category=ec-demo-runs&service=ec-frame&opt=subcat&ct=clocks&subcat=wall
(1) Rewrite URL to >> /ec-user/default.asp?category=ec-demo-runs&service=ec-frame&opt=subcat&ct=clocks&subcat=wall
(2) rewrite 'products/clocks/wall.html' -> '/ec-user/default.asp?category=ec-demo-runs&service=ec-frame&opt=subcat&ct=clocks&subcat=wall'
(2) internal redirect with /ec-user/default.asp?category=ec-demo-runs&service=ec-frame&opt=subcat&ct=clocks&subcat=wall [INTERNAL REDIRECT]

This one doesn't:

http://www/le-west.co.uk/products/equipment/training.html

And the log shows:

(2) init rewrite engine with requested uri /products/equipment/training.html
(1) Htaccess process request 
(1) Htaccess process request d:\inetpub\wwwroot\le-west\website\.htaccess
(3) applying pattern 'products/(.*)/(.*)\.[htm|html]' to uri 'equipment/training.html'
(3) applying pattern 'search/(.*)\.htm' to uri 'equipment/training.html'

Something I noticed immediately is that for the one that works, the URI being considered includes "products/" and for the one that fails, it doesn't.

Neither .htacess file has a BASE directive, so they should both assume the site root, surely?

 

What's going on here?



__________________
--
Marc
Back to Top View cleo-marc's Profile Search for other posts by cleo-marc Visit cleo-marc's Homepage
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 600
Posted: 17 July 2008 at 11:15am | IP Logged Quote Vyacheslav

Hi cleo-marc!

Please try to add this code at the top of your config:
Code:
RewriteBase /


__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
cleo-marc
Newbie
Newbie


Joined: 03 July 2008
Location: United Kingdom
Online Status: Offline
Posts: 14
Posted: 17 July 2008 at 11:19am | IP Logged Quote cleo-marc

Vyacheslav wrote:
Hi cleo-marc!

Please try to add this code at the top of your config:
Code:
RewriteBase /

Yep- that's done it.  Any idea why the two sites have assumed different bases, though?  The documentation implies that RewriteBase is not needed!

 



__________________
--
Marc
Back to Top View cleo-marc's Profile Search for other posts by cleo-marc Visit cleo-marc's Homepage
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 600
Posted: 17 July 2008 at 11:25am | IP Logged Quote Vyacheslav

Without RewriteBase, if you site placed in non-root directory, ISAPI_Rewrite automaticly sets RewriteBase to local path. But in your case, rule must have root base.

__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
cleo-marc
Newbie
Newbie


Joined: 03 July 2008
Location: United Kingdom
Online Status: Offline
Posts: 14
Posted: 17 July 2008 at 11:34am | IP Logged Quote cleo-marc

Vyacheslav wrote:
Without RewriteBase, if you site placed in non-root directory, ISAPI_Rewrite automaticly sets RewriteBase to local path. But in your case, rule must have root base.

That's why I'm confused:  both sites are running from the website root.  One correctly assumes root relative, the other one doesn't.

One site runs from D:\inetpub\wwwroot\ecommerce\website\

The other from D:\inetpub\wwwroot\le-west\website\

They use exactly the same codebase with different datasets.

There is no RewriteBase directive in the yournewshop site, but it correctly processes the "products/" rule.  Weird.

I'll stick a RewriteBase / in all files from now on, just in case.

When would you want it set to anything else? I don't think I quite grasp what it's for.

 



__________________
--
Marc
Back to Top View cleo-marc's Profile Search for other posts by cleo-marc Visit cleo-marc's Homepage
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 600
Posted: 18 July 2008 at 4:36am | IP Logged Quote Vyacheslav

Hi cleo-marc.

Yes. You are right, it's strange . Please setup a variable RewriteLogLevel to 9 and provide to us full logs for both requests.
Also, please make sure, that your requests are identical.

__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav'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