mwanji / essayist

A blogging app for the tent.io protocol
10 stars 2 forks source link

Support domain mapping to entities #66

Open pjesi opened 11 years ago

pjesi commented 11 years ago

I would like to configure a custom URL for my profile that would map to my entity. I am already working on the code but I am not quite sure how to add the domain to the db stuff.

pjesi commented 11 years ago

@mwanji, can you review this branch for me?

mwanji commented 11 years ago

Do you think we could implement custom domains with URL rewriting? Eg.

http://mwanji.myessayist.com/essay/123 => http://www.myessayist.com/mwanji/essay/123

I think this could happen in a new filter or, at worst, by subclassing and modifying MerfFilter.

The advantage is that we wouldn't have to touch the controllers.

pjesi commented 11 years ago

Could the filter also rewrite:

http://mwanji.com/essay/123 => http://www.myessayist.com/mwanji/essay/123

I am not 100% if URL rewrite works on the full URL or just the path. Would have to check. But it definitely sounds like a cleaner approach.

mwanji commented 11 years ago

I believe the HttpServletRequestWraapper allows you you to override every method on HttpServletRequest, so it should be feasible.

pjesi commented 11 years ago

Of course, you are right. I had forgot about how this works.

On Sat, Feb 2, 2013 at 6:25 AM, Moandji Ezana notifications@github.comwrote:

I believe the HttpServletRequestWraapper allows you you to override every method on HttpServletRequest, so it should be feasible.

— Reply to this email directly or view it on GitHubhttps://github.com/mwanji/essayist/issues/66#issuecomment-13025454.