This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Rewritemap with multiple folders
Author
Message |
rmeier
Newbie


Joined: 07 November 2011
Posts: 2
Posted: 07 November 2011 at 7:26pm

Hi,

I have a website with four types of folders and
subfolders:

1 - Brand - "Ford"
2 - Model - "Focus"
3 - Year - "2012"
4 - Trim - "SEL"

To show only de brand a have a file called brand.asp?
cod=1

and I want to rewrite to /ford/

Another file return the model: model.asp?cod=5

and I want to rewrite to /ford/focus/

The same situation for the year and trim

/ford/focus/2012/
/ford/focus/2012/sel.html

I tried this but I have error messages:

RewriteMap brand txt:brand.txt [NC]
RewriteRule ^(.+?)/?$ brand.asp?cod=${brand:$1} [NC,L]

RewriteMap model txt:model.txt [NC]
RewriteRule ^(.+?)/?$ model.asp?cod=${model:$1} [NC,L]

Thanks,

Ricardo
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 11 November 2011 at 5:42am

Hello Ricardo,

You need some additional conditions for your rules:

RewriteMap brand txt:brand.txt [NC]
RewriteCond ${brand:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(.+?)/?$ brand.asp?cod=${brand:$1} [NC,L]

RewriteMap model txt:model.txt [NC]
RewriteCond ${model:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(.+?)/?$ model.asp?cod=${model:$1} [NC,L]

In case this doesn't help, please, provide the rewrite.log for the testing request.
Logging issues described in FAQ

Regards
Andrew
Back to Top
 
rmeier
Newbie


Joined: 07 November 2011
Posts: 2
Posted: 15 November 2011 at 6:44pm

Thank you, Andrew, it works!
Back to Top
 

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

Printable version Printable version