Topic: rules not working in directory
|

|
| Author |
|
DesignsOnline Newbie

Joined: 09 April 2011
Online Status: Offline Posts: 3
|
| Posted: 14 February 2012 at 10:30am | IP Logged
|
|
|
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 |
|
| |
DesignsOnline Newbie

Joined: 09 April 2011
Online Status: Offline Posts: 3
|
| Posted: 15 February 2012 at 4:15am | IP Logged
|
|
|
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 |
|
| |
Anton Admin Group

Joined: 30 January 2007 Location: Ukraine
Online Status: Offline Posts: 10520
|
| Posted: 15 February 2012 at 6:00am | IP Logged
|
|
|
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
Online Status: Offline Posts: 10520
|
| Posted: 15 February 2012 at 6:01am | IP Logged
|
|
|
I didn't see you message. Happy that you've resolved it.
__________________ Regards,
Anton
|
| Back to Top |
|
| |
DesignsOnline Newbie

Joined: 09 April 2011
Online Status: Offline Posts: 3
|
| Posted: 15 February 2012 at 7:29am | IP Logged
|
|
|
no problem, thanks
|
| Back to Top |
|
| |
|
|
Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.
|
|
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
|