Dynamic UrlRewrites

18 views
Skip to first unread message

skpullano

unread,
Nov 13, 2009, 5:41:32 PM11/13/09
to UrlRewrite
Hello,
I have a website url below:

http://www.mybuyersagent.com/MBAApp/app.do?txntyp=realtor&st=39&city=7&lk=44

This is a profile page for a realtor. I want to make this url be:


http://www.mybuyersagent.com/larry

I was able to get this working with this framework. However, it is to
difficult to manage an xml file entry for every user. I would like my
users to be able to select a username for their profile and instantly
have the url www.mybuyersagent.com/larry .......work. Is there a way i
can do this via this framework?
Thanks,
Scott

Avlesh Singh

unread,
Nov 13, 2009, 11:32:09 PM11/13/09
to urlre...@googlegroups.com
I was able to get this working with this framework. However, it is to difficult to manage an xml file entry for every user. I would like my users to be able to select a username for their profile and instantly have the url www.mybuyersagent.com/larry .......work. Is there a way i can do this via this framework?
To answer your question upfront, Yes and No.

Yes, because you can modify the urlrewrite.xml file dynamically in your application. This would force the filter to reload the config (if confReloadCheckInterval is set to > 0). Once it does so, the new rules will take effect.

No, because there are multiple issues with the approach mentioned above -
  1. Your filter config file might grow crazy if you are not talking about a limited number of users. The filter might become a performance bottleneck for every request as it has to process those many rules for rewriting.
  2. You have to make sure that the changes you have done in your web-application's urlrewrite.xml file (by dynamically adding users) don't get overwritten when you deploy your web app for the next time.
Bottomline, such use cases are better handled by application logic. You can use database as the persistence layer instead of the filter's config file. A custom filter to handle such stuff is probably an answer.

Cheers
Avlesh
Reply all
Reply to author
Forward
0 new messages