<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx</link><description>Today I played around a little bit more with HttpModules and implemented a more elegant solution for the problem as discussed in my previous post . Especially the second problem - normal postback caused by ASP.NET controls - was not properly solved as</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#118875</link><pubDate>Fri, 23 Apr 2004 22:23:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:118875</guid><dc:creator>Alex</dc:creator><description>Hi Stefan!&lt;br&gt;We are moving to MSCMS and your blog is a treasure chest for us. Thanks a lot!</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#118928</link><pubDate>Sat, 24 Apr 2004 00:04:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:118928</guid><dc:creator>Role</dc:creator><description>Hi Stefan, great stuff. I have implemented the HttpModule in the Web.config. Now, when I switch to edit site there is a javascript runtime error message '__CMS_PostbackForm' is undefined. Do you have a idea, what I have made wrong?&lt;br&gt;&lt;br&gt;Thanks</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#118980</link><pubDate>Sat, 24 Apr 2004 01:38:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:118980</guid><dc:creator>Stefan</dc:creator><description>This was a bug. :-(&lt;br&gt;When I wrote this blog and copied the code I missed to include the &amp;quot;\n&amp;quot; chars in the script blog. The code above should work now.&lt;br&gt;&lt;br&gt;Sorry for that!</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#119007</link><pubDate>Sat, 24 Apr 2004 02:13:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:119007</guid><dc:creator>Role</dc:creator><description>Ok. It works great now! thanks</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#119169</link><pubDate>Sat, 24 Apr 2004 05:46:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:119169</guid><dc:creator>AndrewSeven</dc:creator><description>Hi Stefan,&lt;br&gt;&lt;br&gt;I've been digging into this issue again due to some problems with pages/postings using IE on Macs.&lt;br&gt;&lt;br&gt;I'd love it if you could have a look and tell me what you think. Especially if you have ideas about multiple root channels.&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://weblogs.asp.net/andrewseven/archive/2004/04/23/ElegantMCMSUrls.aspx"&gt;http://weblogs.asp.net/andrewseven/archive/2004/04/23/ElegantMCMSUrls.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;-Andrew</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#119180</link><pubDate>Sat, 24 Apr 2004 06:02:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:119180</guid><dc:creator>Stefan</dc:creator><description>Hi Andrew, &lt;br&gt;&lt;br&gt;I have commented your blog.&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;Stefan.</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#120859</link><pubDate>Tue, 27 Apr 2004 15:43:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:120859</guid><dc:creator>Rooc</dc:creator><description>Hi Stefan,&lt;br&gt;&lt;br&gt;This works nicely but I added the current querystring (when available) to the 'nice url', so when available I get the Request.QueryString[&amp;quot;NRORIGINALURL&amp;quot;] instead of the ChannelItem.Url.&lt;br&gt;&lt;br&gt;//////////////////////////////&lt;br&gt;//create the nice url&lt;br&gt;string niceurl = CmsHttpContext.Current.ChannelItem.Url;&lt;br&gt;&lt;br&gt;if (x.Request.QueryString[&amp;quot;NRORIGINALURL&amp;quot;] != null &amp;amp;&amp;amp; x.Request.QueryString[&amp;quot;NRORIGINALURL&amp;quot;].Length &amp;gt; 0)&lt;br&gt;{&lt;br&gt;  niceurl = x.Request.QueryString[&amp;quot;NRORIGINALURL&amp;quot;];&lt;br&gt;}</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#120869</link><pubDate>Tue, 27 Apr 2004 16:07:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:120869</guid><dc:creator>Stefan</dc:creator><description>Hi Rooc,&lt;br&gt;&lt;br&gt;thanks for the suggestion. Only problem: NRORIGINALURL only works with a specific hotfix on SP1a. So it would only be a solution for users which use this hotfix....&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;Stefan.</description></item><item><title>Solving the </title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#122528</link><pubDate>Thu, 29 Apr 2004 02:37:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:122528</guid><dc:creator>Stefan Go</dc:creator><description /></item><item><title>Solving the </title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#124394</link><pubDate>Sat, 01 May 2004 09:45:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:124394</guid><dc:creator>Stefan Go</dc:creator><description /></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#125580</link><pubDate>Tue, 04 May 2004 19:55:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:125580</guid><dc:creator>Chinye</dc:creator><description>Please could you tell me where I insert the above code? Is it in the template .aspx file? It is urgent. Thanx</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#148735</link><pubDate>Sat, 05 Jun 2004 04:17:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:148735</guid><dc:creator>James</dc:creator><description>I have encountered a problem with this where I seem to get random pieces of HTML appended on the end of the page after the &amp;lt;/HTML&amp;gt; tag. Sometimes it happens when switching between edit mode &amp;amp; live mode, and sometimes just when navigating the site.&lt;br&gt;&lt;br&gt;Any idea ? </description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#149533</link><pubDate>Sun, 06 Jun 2004 18:47:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:149533</guid><dc:creator>Stefan</dc:creator><description>Hi Chinye,&lt;br&gt;&lt;br&gt;you need to create a new class library project and compile the above code into a DLL. Then add this DLL to the http module section of your web.config.&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;Stefan.</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#150993</link><pubDate>Wed, 09 Jun 2004 00:28:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:150993</guid><dc:creator>Mike</dc:creator><description>&lt;br&gt;Wouldn't the most elegant solution be to actually change the action value on the form to the url of the posting?&lt;br&gt;&lt;br&gt;This technique is explained in the following MSDN article (&lt;a target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp&lt;/a&gt;)&lt;br&gt;&lt;br&gt;In short you create a customForm which inherits from HtmlForm and change the RenderAttributes method to correctly write the action tag.  Unlike the article I set the action tag to the url of the posting.&lt;br&gt;&lt;br&gt;Unfortunatly, this does not work because the Console SetPageForm method requires a HtmlForm. This method is private and I can't override it.&lt;br&gt;&lt;br&gt;Do you agree that this would be the most elegant solution?  Is there someother way to change the action attribute of the form tag?&lt;br&gt;&lt;br&gt;</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#151001</link><pubDate>Wed, 09 Jun 2004 00:35:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:151001</guid><dc:creator>Stefan</dc:creator><description>not necessarily as it will require to use a different class for your forms. It is not transparent to your application.</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#154264</link><pubDate>Sun, 13 Jun 2004 02:55:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:154264</guid><dc:creator>Chris</dc:creator><description>Hi Stefan,&lt;br&gt;&lt;br&gt;We have implemented this module, along with the SSL module, and we still seem to get the ugly URL's when switching between secure / non-secure pages.&lt;br&gt;&lt;br&gt;eg.  if you go from https - http the URL is &amp;quot;ugly&amp;quot;, but if you navigate to a subsequent http page, it will correct itself.  The same is also true in reverse. (http - https - https)&lt;br&gt;&lt;br&gt;any ideas?&lt;br&gt;&lt;br&gt;BTW, your site is a great help...thanks</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#154571</link><pubDate>Sun, 13 Jun 2004 20:18:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:154571</guid><dc:creator>Stefan</dc:creator><description>Hm... I did not test this scenario.&lt;br&gt;How do you switch between SSL and non SSL?&lt;br&gt;Using this approach:&lt;br&gt;&lt;a target="_new" href="http://blogs.msdn.com/stefan_gossner/archive/2004/04/22/118024.aspx"&gt;http://blogs.msdn.com/stefan_gossner/archive/2004/04/22/118024.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;Stefan.</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#154658</link><pubDate>Mon, 14 Jun 2004 01:46:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:154658</guid><dc:creator>Chris</dc:creator><description>Hi Stefan,&lt;br&gt;&lt;br&gt;Yes, we are using your ssl module.&lt;br&gt;&lt;br&gt;Chris</description></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#155002</link><pubDate>Mon, 14 Jun 2004 18:45:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:155002</guid><dc:creator>Stefan</dc:creator><description>I have analyzed this problem. The reason is that that the CmsSslHttpModule does a redirect to the Url it receives with either http or https. This Url is already the internal Url as the request already has passed the MCMS ISAPI filter. This redirect will now return to the browser and show the ugly URL. &lt;br&gt;To correct this it would be necessary to ensure that the redirected URL from the CmsSslHttpModule is a friendly URL rather than the ugly one. &lt;br&gt;I will check if there is an easy solution for this and post it to the CmsSslHttpModule or as a separate post.</description></item><item><title>Update for the MCMS SSL Http Module</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#155233</link><pubDate>Mon, 14 Jun 2004 19:47:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:155233</guid><dc:creator>Stefan Go</dc:creator><description /></item><item><title>Update for the MCMS SSL Http Module (last updated: July 3rd, 2004)</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#172369</link><pubDate>Sat, 03 Jul 2004 14:58:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:172369</guid><dc:creator>Stefan Go</dc:creator><description /></item><item><title>re: A more elegant solution to avoid ugly URL's with MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#212211</link><pubDate>Wed, 11 Aug 2004 05:20:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:212211</guid><dc:creator>Randall</dc:creator><description>Hi Stefan,&lt;br&gt;&lt;br&gt;Can you please suggest the steps to implement this code.&lt;br&gt;Means I didn't understand where to write the code?&lt;br&gt;&lt;br&gt;Thanks for all your help.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Randall</description></item><item><title>MCMS tip of the day - how to avoid ugly URLs in MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#404770</link><pubDate>Wed, 11 May 2005 13:26:04 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:404770</guid><dc:creator>Stefan Goßner</dc:creator><description>There are two different reasons for ugly URL's on in presentation mode: &lt;br&gt;&lt;br&gt;when using Webauthor and...</description></item><item><title>Axionic Blog  &amp;raquo; Blog Archive   &amp;raquo; Resolving Ugly URL&amp;#8217;s in MCMS</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#419063</link><pubDate>Thu, 09 Feb 2006 04:36:01 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:419063</guid><dc:creator>Axionic Blog  » Blog Archive   » Resolving Ugly URL’s in MCMS</dc:creator><description>PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.axionic.com/?p=42"&gt;http://blog.axionic.com/?p=42&lt;/a&gt;</description></item><item><title>Long Url issue with MCMS Websites ... | keyongtech</title><link>http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx#3189369</link><pubDate>Thu, 22 Jan 2009 07:08:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3189369</guid><dc:creator>Long Url issue with MCMS Websites ... | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/360770-long-url-issue-with-mcms"&gt;http://www.keyongtech.com/360770-long-url-issue-with-mcms&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>