DOWNLOAD DEMO
Current Version: 2.3.9.7 2013-04-30
Need a hand? Join the community.

UrlRewriting pass-thru.

This thread is closed to new posts. You must sign in to post in the forums.
9/18/2011 8:30:09 PM
bob
Gravatar
Total Posts 127
YAF developer

UrlRewriting pass-thru.

I've crossbread forum UrlRewriting with Mojo rewriter but it's completely unusable as MP stores frendly urls in a table. Which means hundreds thousand  even for a forum records even for a forum with 1000-2000 users. It's completely unacceptable.

Is there any workaround to not fill in the table and make rewriting on the fly?

9/19/2011 8:33:56 AM
Gravatar
Total Posts 16569

Re: UrlRewriting pass-thru.

Hi Bob,

The mojoPortal url rewriter only re-writes urls that do exist in the database, therefore it will not rewrite anything else and should not interfere with any other urls tha are not defined in the database.

The url rewriter is plugged in from Web.config in the <httpModules section for IIS 6 or IIS 7 using Classic mode  

<add name="mojoUrlRewriter" type="mojoPortal.Web.UrlRewriter, mojoPortal.Web"/>

or for IIS 7 using Integrated app pool it is plugged in at the <system.webServer> <modules section

<add name="mojoUrlRewriter" type="mojoPortal.Web.UrlRewriter, mojoPortal.Web" preCondition=""/>

Note that the order in which Http modules are listed in these sections is the order in which they will execute, so if you plug in the YAF url rewriter below it then it will execute after the mojoPortal url re-writer and if you put it above the mojoPortal url rewriter it will work first.

So mojoPortal will not interfere with YAF urls, but the question is whetgher the YAF re-writer will re-write only urls for YAF or whether it may try to rewrite other urls that should be re-written by mojoPortal. I guess YAF uses a pattern based url rewriting but its needs to be configured so it only re-writes urls for YAF.

One possible solution is that if the mojoPortal url rewriter runs first we could set a variable in HttpContext.Items["DidRewriteUrl"] = true;

Then in the YAF url rewriter you could check and see if the url was already rewriten and if so leave it alone. 

But if the YAF url rewriter can already be configured to not rewrite urls if they don't match a pattern then it may not be needed.

I would not try to combine them into one url rewriter, I would keep them separate and just find a way to make sure they don't step on each other.

Hope that helps,

Joe

9/20/2011 4:01:54 AM
bob
Gravatar
Total Posts 127
YAF developer

Re: UrlRewriting pass-thru.

Hi, Joe.

Now it works like a charm. I've separated the rewriting and made a special UrlRewriting config for MP. The module is loaded after MP rewriting.

Bad news - I changed some things in YAF related to rewriting, so 1.9.6 Beta 1 code is no more compatible . It's required to use the codeplex latest repo. It contains some fixes for MP too.

Thanks for help.

Best, bob.

You must sign in to post in the forums. This thread is closed to new posts.

mojoPortal Hosting Made Easy

Go Mobile with mojoPortal and Mobile Kit Pro!