UrlRewriting pass-thru.

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
9/18/2011 7:30:09 PM
bob
Gravatar
Total Posts 126
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 7:33:56 AM
Gravatar
Total Posts 18439

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 3:01:54 AM
bob
Gravatar
Total Posts 126
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.