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: rules not working in directory
Author
Message |
DesignsOnline
Newbie


Joined: 09 April 2011
Posts: 3
Posted: 14 February 2012 at 10:30am

Hi our web host openmind hosting has rewrite V.2.0 installed
and we usually use it on our clientd website for ecommerce website and the rules work perfectly.

However we have now decided to install a demo ecommerce system on our own website and have created a sub directory called: demo-ecommerce

and installed our ecommerce system in it.

The rules are now behavinbg very stragely, sometimes they work and sometimes they dont.

Let me show you the rules we use when the website is installed in the root directory of a hosting account:

[ISAPI_Rewrite]

#Images & Css
RewriteRule .*\.(?:css|jpg|png|js|gif) $0 

#product rules

RewriteRule /P(\d+).*\-C(\d+)\.asp /productdetails.asp\?ProductID=$1&SubCatagoryID=$2 [I,L] 
RewriteRule /P(\d+)-pg(\d+)(.*)\.asp    /productdetails.asp\?ProductID=$1 [I,L]
RewriteRule /P(\d+)(.*)\.asp    /productdetails.asp\?ProductID=$1 [I,L]


#category rules
RewriteRule /d(\d+)-pg(\d+)(.*?)/?        /Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule /d(\d+)(.*?)/?        /Products.asp\?SubCatagoryID=$1 [I,L]


This works perfectly, now we initially installed the same rules in to the folder /demo-ecommerce
and it didnt work, so we deleted it and installed it in to the root of the website but with the following modifications (with a little help from Phil of Open Mind Hosting):

[ISAPI_Rewrite]

#Images & Css
RewriteRule .*\.(?:css|jpg|png|js|gif) $0 

#product rules

RewriteRule /demo-ecommerce/P(\d+).*\-C(\d+)\.asp /demo-ecommerce/productdetails.asp\?ProductID=$1&SubCatagoryID=$2 [I,L] 
RewriteRule /demo-ecommerce/P(\d+)-pg(\d+)(.*)\.asp    /demo-ecommerce/productdetails.asp\?ProductID=$1 [I,L]
RewriteRule /demo-ecommerce/P(\d+)(.*)\.asp    /demo-ecommerce/productdetails.asp\?ProductID=$1 [I,L]


#category rules
RewriteRule /demo-ecommerce/d(\d+)-pg(\d+)(.*?)/?        /demo-ecommerce/Products.asp\?SubCatagoryID=$1 [I,RP,L]
RewriteRule /demo-ecommerce/d(\d+)(.*?)/?        /demo-ecommerce/Products.asp\?SubCatagoryID=$1 [I,L]

If we now visit the website via the following address the links dont work:
http://www.designsonline.co.uk/demo-ecommerce

however if we follow the links via a product url:
http://www.designsonline.co.uk/demo-ecommerce/P1521-Cartier-Ballon-Bleu-18ct-Pink-Gold-C600.asp

and then follow the links back to the homepage everything seems to work. Why is this?


in fact something else that might help is ive discovered also that if I click a link from the homepage and it doesnt work, then I just select the URL that isnt working and press enter, it then works...??

Please help


Back to Top Visit DesignsOnline's Homepage
 
DesignsOnline
Newbie


Joined: 09 April 2011
Posts: 3
Posted: 15 February 2012 at 4:15am

ok ive worked out what the problem was.
in case you are having the same or similar problem I will share my resolution here:

This is the offending line:
RewriteRule /demo-ecommerce/P(\d+).*\-C(\d+)\.asp /demo-ecommerce/productdetails.asp\?ProductID=$1&SubCatagoryID=$2 [I,L] 

I noticed that the spacing wasnt exact, so I adjusted it to this:
RewriteRule /demo-ecommerce/P(\d+).*\-C(\d+)\.asp    /demo-ecommerce/productdetails.asp\?ProductID=$1&SubCatagoryID=$2 [I,L] 

and it now works.


Back to Top Visit DesignsOnline's Homepage
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 15 February 2012 at 6:00am

Hello,

"If we now visit the website via the following address the links dont work: http://www.designsonline.co.uk/demo-ecommerce"
- do you have any base tag specified on the pages?
- i followed this URL http://www.designsonline.co.uk/demo-ecommerce and all links from the page worked for me. How can I see the issue?

__________________
Regards,
Anton
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 15 February 2012 at 6:01am

I didn't see you message. Happy that you've resolved it.

__________________
Regards,
Anton
Back to Top
 
DesignsOnline
Newbie


Joined: 09 April 2011
Posts: 3
Posted: 15 February 2012 at 7:29am

no problem, thanks
Back to Top Visit DesignsOnline'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