URL Rewrite Questions

1 view
Skip to first unread message

jeffdonthemic

unread,
Aug 15, 2008, 8:13:56 AM8/15/08
to Mach-II for CFML
We are building a community site and I'm trying to create some
friendly URLs so that people can pass them out easily. I just started
looking at Mach-II and have an IIS rewrite (IsapiRewrite4) working on
our servers.

I would like to create a URL structure similar to LinkedIn's:

http://www.linkedin.com/in/[my-user-name]

I suppose I *could* create a folder for each user but I would rather
pass a username/id and then load a standard page with the user's
profile from the db. Is this URL structure possible with Mach-II?

Thanks
Jeff

Peter J. Farrell

unread,
Aug 28, 2008, 12:04:02 AM8/28/08
to mach-ii-for...@googlegroups.com
jeffdonthemic said the following on 8/15/2008 7:13 AM:
I think you've answered your question yourself. Getting urls like this
all happen before Mach-II can get its hands on the request. Basically
you'll have to get your rewrite utility to rewrite the url into
something Mach-II can understand. It should not be too hard to get this:

http://www.example.com/in/peterfarrell/

To be rewritten to:

http:///www.example.com/index.cfm?event=showUserHome&userName=peterfarrell

Best,
.Peter

.jonah

unread,
Aug 28, 2008, 4:30:23 PM8/28/08
to Mach-II for CFML
Yup! Your ISAPI rewrite rule could look something like this:

RewriteRule (.*)\?(.*) /?event=showPage&url=$1&$2

The rules are largely straight-up regex.
Reply all
Reply to author
Forward
0 new messages