how to convert url to folder

Feb 14, 2008 at 5:07 PM
Hi all

Can someone tell me what I need to do so instead of having folder for each city I would like to have one dynamic file but to users it would show folder ....com/folder/

when user types http://www.site.com/chicago in reality it uses http://www.site.com/city.cfm?id=chicago

Thank YOu!
Feb 14, 2008 at 6:44 PM
Hi... Have you read the manual? That's exactly what Ioncis does...

Your rule would look like this:

RewriteRule ^/(\w+)$ /city.cfm?id=$1

Now, depending on the other urls on your site, the above rule may not work for your situation. So you may want to modify the structure a bit so it's more unique.

You could use a url like; www.site.com/city/chicago/ and have that be processed by /city.cfm. That rule would look like:

RewriteRule ^/city/(\w+)/$ /city.cfm?id=$1

This just means, any url with /city/ in it is analized and and processed by Ionics and if found as a match, is sent to the specified processing page . This would also prevent other URLs from being captured by the rule I initially showed; such as www.site.com/goober; see what I mean?

Best of luck.
Feb 14, 2008 at 7:00 PM
Edited Feb 14, 2008 at 7:44 PM
ok so the first example will rewrite urls for even a folders that do exists like, www.site.com/contacts. I really want urls to be www.site.com/chicago, so is there a way to have this filter only on specified folder names?
Feb 14, 2008 at 7:51 PM
Edited Feb 14, 2008 at 8:08 PM
would this be it: RewriteRule ^/chicago /city.cfm?id=chicago

also if I want to have another filter for state is it better just to use same isapi filter in IIS or should I crate another filter?
Coordinator
Feb 14, 2008 at 9:10 PM
Same filter, different rule.
Try the testdriver.exe program.

Also consider reading the ReadMe.
Feb 14, 2008 at 9:49 PM
thank you, I think I figured out most of it, one more thing, are the tags case sensitive, so when I do RewriteRule ^/CHICAGO it won't be accessible through www.site.com/chicago ?
Coordinator
Feb 15, 2008 at 12:58 AM
yes, that is correct. That is also covered in the ReadMe.