rewriting url in asp.net -


hey guys, using asp.net 2.0 , dotnetnuke 5.6, , using crossarticle module, want user can create multiple alias article.

say below. article/stackoverflow stackexchange/article etc..

say first article linked article id 1, , second linked articleid 2 should jump respective pages.. article/1 or article/2

i can web.config file... problem there lacs of alias'es, maintaining in web.config file totally flop idea. want global.asax file..

i tried below code:

in string variable saved: request.rawurl.tostring() , comparing url user entered , redirecting him appropriate page...

but having below issues: dont want user redirect want rewrite url, i.e, if user enters article/stackoverflow... should redirected article/1 page url should retain.

please suggest issue..

to rewrite url (as opposed redirecting) can this:

private static void rewriteurl(httpapplication application, tabinfo tabinfo, string additionalquerystring) {     application.context.items["urlrewrite:originalurl"] = application.request.url.absoluteuri;      var portalaliasinfo = portalaliascontroller.getportalaliasinfo(application.context.request.url.dnssafehost);             application.context.items["portalsettings"] = new portalsettings(tabinfo.tabid, portalaliasinfo);      var querystring = string.format("tabid={0}" + additionalquerystring, tabinfo.tabid);     application.context.rewritepath("~/default.aspx", string.empty, querystring, false); } 

i'd recommend doing in httpmodule though instead of modifying core code.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -