Help needed with the RegEx & Iirf.ini

Topics: User Forum
Feb 2, 2011 at 10:44 AM

  # Incoming URL --> Expected Result

/agentName  --> /ns/list_sectors_per_agent.asp?agent=agentName

/otherAgentName --> /ns/list_sectors_per_agent.asp?agent=otherAgentName 

/admin --> /admin  # Special case, no change when "admin"
 

/ns/home.asp --> /ns/home.asp   # No change when there is a script with extension (.asp)



Can someone suggest the Iirf.ini structure please?
I cant seem to differentiate between /admin which must remain unchanged and /anAgentsName which must rewrite

Coordinator
Feb 2, 2011 at 2:37 PM
## don't rewrite urls that start with /admin . 
## pass them through unchanged.
RewriteRule ^/admin  -  [L]

## don't rewrite when the url looks like /ns/AnythingHere.asp 
RewriteRule ^/ns/([^/]+\.asp)  -  [L]

## rewrite agent names
RewriteRule ^/([^/]+)   /ns/list_sectors.asp?agent=$1