Rules needed?

Topics: User Forum
Coordinator
Aug 5, 2008 at 5:33 PM
someone wrote:
I need to have a filter written for the changes below. Here's what I'm looking to do:

CHANGE: catalog.asp?catid=109  (where catid can be up to 3 characters)
TO: catalog/109

CHANGE: detail.asp?id=1590  (where id can be any number of characters)
TO: item/1590

CHANGE: collectors.asp?catid=104 (where catid can be up to 3 characters)
TO: collectors/104

CHANGE: collectorcatalog.asp?userid=224 (where userid can be any number of characters)
TO: collector/224
Coordinator
Aug 5, 2008 at 5:34 PM

how about these? 

# CHANGE: catalog.asp?catid=109  (where catid can be up to 3 characters)
# TO: catalog/109
RewriteRule ^/catalog/([0-9]{1,3})$      /catalog.asp?catid=$1  [L]
 
# CHANGE: detail.asp?id=1590  (where id can be any number of characters)
# TO: item/1590
RewriteRule ^/item/([0-9]+)$              /detail.asp?id=$1  [L]
 
# CHANGE: collectors.asp?catid=104 (where catid can be up to 3 characters)
# TO: collectors/104
RewriteRule ^/collectors/([0-9]{1,3})$    /collectors.asp?catid=$1  [L]
 
# CHANGE: collectorcatalog.asp?userid=224 (where userid can be any number of characters)
# TO: collector/224
RewriteRule ^/collector/([0-9]+)$         /collectorcatalog.asp?userid=$1  [L]