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: Understanding the very basics
Author
Message |
aspnewb
Newbie


Joined: 20 April 2011
Location: United Kingdom
Posts: 19
Posted: 27 April 2011 at 4:42am

Of course it wouldnt pass any details, that isnt the point, the point was that that simple URL without the / in it worked perfectly without breaking the css or images or navigation.

I have implemented your suggested changes above and it makes no difference
Back to Top
 
aspnewb
Newbie


Joined: 20 April 2011
Location: United Kingdom
Posts: 19
Posted: 27 April 2011 at 5:34am

I have had another idea, it isnt really how I wanted this to work, but if it can work, then it will solve the problem and be better than nothing.

I have the first part working well, now I just need to pass the catagoryID details too, as a forward slash is breaking everything for some unknown reason, what about using the productdetails page with a ?d=253-CatagoryName at the end

Something like:
http://www.mydomain.com/P1543-ProductName.asp?d253-CatagoryName

I have had a guess at the rule, but not supprisingly it isnt working:

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

and I tried:

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

even if I could get it to work as:
http://www.mydomain.com/P1543-ProductName.asp?d253
I would be happy, or even pass the categoryid and product details in the asp file name something like:
http://www.mydomain.com/c253-P1543-ProductName.asp
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 28 April 2011 at 1:56am

Ok,
for this http://www.mydomain.com/P1543-ProductName.asp?d253-CatagoryName you can have the following rule:

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

__________________
Regards,
Anton
Back to Top
 
aspnewb
Newbie


Joined: 20 April 2011
Location: United Kingdom
Posts: 19
Posted: 28 April 2011 at 7:37am

Thank you, and if I wanted to  use this format:
http://www.mydomain.com/c253-P1543-ProductName.asp

How would I do that, is it possible?
Back to Top
 
aspnewb
Newbie


Joined: 20 April 2011
Location: United Kingdom
Posts: 19
Posted: 28 April 2011 at 8:38am

Ive worked it out, for anyone else trying to do the same it is:

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

However I have found that when I add [I,RP,L] to the end it loads the page, but displays it as the original www.website.com/productdetails.asp?ProductID=1435&SubCatagoryID=355

If I remove the RP from the box at the end it displays the URL as www.website.com/P1435-Product-Name-C355.asp

But I want it to be a permenant redirect, and I thought that was what the [RP] meant, so why does it work, but display the wrong URL?

(It is behaving more like a redirect than a rewrite!)
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 29 April 2011 at 3:36am

"However I have found that when I add [I,RP,L] to the end it loads the page, but displays it as the original
www.website.com/productdetails.asp?ProductID=1435&SubCatagoryID=355"
- this is contrary to the way ISAPI_Rewrite normally works...
Could you please show the entire config you are using.
And please confirm it's v2 of ISAPI_Rewrite.

__________________
Regards,
Anton
Back to Top
 
aspnewb
Newbie


Joined: 20 April 2011
Location: United Kingdom
Posts: 19
Posted: 29 April 2011 at 4:28am

Hi yes it is definately rewrite 2 im using, here is the httpd.ini


[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,RP,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]
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 04 May 2011 at 2:54am

Hello,

I guess you are mixing something up, 'cause as far as I understand you don't need RP flag after your rules as it's logical to REWRITE seo-
friendly URLs behind the scenes, not REDIRECT them explicitly to have original URL in address bar.

__________________
Regards,
Anton
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

<< Prev Page of 2
 
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