johnk
  •  johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
2013-05-28T01:03:18Z
The default URL rewriter rules works correctly if app.config file has the default value

<add key="YAF.UrlRewritingPrefix" value="yaf_" />

However if we change the value in app.config value to

<add key="YAF.UrlRewritingPrefix" value="" />

Then many (or all) URL rewriter rules fails and it gives a "Resource cannot be found" error for all pages.

To fix this bug, I had to remove "yaf_" from urlrewiter.config file to correctly redirect pages.

Could we make the rules in file dynamic, so that changing value in app.config does not break the pages.
Sponsor
johnk
  •  johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
2013-05-28T01:11:51Z
Actually removing "yaf_" from app.config and urlrewriter.config (as mentioned above) broke a LOT of pages.

The pages which were broken are in header of the page (my profile, my inbox, my album) and links in main page (new topic, moderate, post reply, etc)

I tried looking inside urlbuilderrewrite.cs file and could not find "yaf_" there.

Is there a way to remove "yaf_" from URLs without breaking the page links?

I am using the latest build from codeplex. I built it manually by running "build.bat" file.

Update: In app.config, I also changed enableurlrewriting = "false". But it still gave me a "resource cannot be found" error. It seems enableurlrewriting=false setting might be broken.

Update 2: enableurlrewriting = "false" is working correctly. I had to stop IIS express and restart it for changes. Unlike web.config, it does not use the latest version automatically.
johnk
  •  johnk
  • 74.8% (Friendly)
  • YAF All-the-Time Topic Starter
2013-05-29T01:50:33Z
I have updated this with more steps. Please see the link below.

http://forum.yetanotherf...-URLrewriter-config.aspx 

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved