YAFLogo

HuyNQ
  • HuyNQ
  • 59% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
Hi all,
I want to know about UrlRewriter. I try to change some code in UrlRewriter.config. Code as

<rewriter>
	<rewrite url="^~/(.+?)?myname_login?\.aspx\?returnurl\=(.+)$" to="~/$1Default.aspx?g=login&amp;ReturnURL=$2" processing="stop" />
	<rewrite url="^~/(.+?)?myname_info?\.aspx\?i=([0-9]+?)&amp;url\=(.+)$" to="~/$1Default.aspx?g=info&amp;i=$2&amp;url=$3" processing="stop" />
	<rewrite url="^~/(.+)?myname_topics([0-9]+)p([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=topics&amp;f=$2&amp;p=$3&amp;$7" processing="stop" />
	<rewrite url="^~/(.+)?myname_topics([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=topics&amp;f=$2&amp;$6" processing="stop" />
	<rewrite url="^~/(.+)?myname_forum([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=forum&amp;c=$2&amp;$6" processing="stop" />
	<rewrite url="^~/(.+)?myname_postst([0-9]+)p([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=posts&amp;t=$2&amp;p=$3&amp;$7" processing="stop" />
	<rewrite url="^~/(.+)?myname_postst([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=posts&amp;t=$2&amp;$6" processing="stop" />
	<rewrite url="^~/(.+)?myname_postsm([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=posts&amp;m=$2&amp;$6" processing="stop" />
	<rewrite url="^~/(.+)?myname_profile([0-9]+)(_([-a-z0-9]+))?\.aspx(\?(.+))?$" to="~/$1Default.aspx?g=profile&amp;u=$2&amp;$6" processing="stop" />
	<rewrite url="^~/(.+)?myname_([-0-9a-z_]+?)\.aspx\?(.+)?$" to="~/$1Default.aspx?g=$2&amp;$3" processing="stop" />
	<rewrite url="^~/(.+)?myname_([-0-9a-z_]+?)\.aspx$" to="~/$1Default.aspx?g=$2" processing="stop" />
</rewriter>
.. but when i reload page and set anableurlrewriting is true

<enableurlrewriting>true</enableurlrewriting>
then project is not run hic .. thanks alot 😞
Hãy để cuộc sống tràn ngập tiếng cười ^^
Sponsor

herman_herman
14 years ago
As i remember you also need to alter the corresponding codes in yaf modules and recompile.
herman_herman
14 years ago
The code you need to modify is located inside "YAF.Classes.Utils" and the file "URLBuilderRewrite.cs".You need to change all yaf prefixes to what you want and recompile.
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
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