siteurls Questions - SnippetGoodmost recent 30 from http://snippetgood.com2010-07-29T23:54:12Zhttp://snippetgood.com/feeds/tag/siteurlshttp://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://snippetgood.com/questions/100/community-server-siteurls-config-and-vanitycommunity server SiteUrls.config and vanityGreg2009-10-15T19:41:53Z2009-11-04T20:57:46Z
<p>How can I manipulate the vanity element in a url node? This is more of a general question, because I know I can get by with vanity={2}, but a lack of proper understanding is holding me back from truly mastering my community server site.</p>
<p>I've seen examples like this in the SiteUrls.config: </p>
<pre><code><url name="post_InPage_Old" path = "{0}/ShowThread.aspx#{1}" pattern = "(\d+)/ShowThread.aspx" vanity="{2}?PostID=$1^PermaPost=$2^UrlName=permalink" page="ForumUrlHandler.ashx" />
</code></pre>
<p>but the format confuses me. What are the $1 and $2? Where are they set?</p>
http://snippetgood.com/questions/47/adding-a-subdirectory-to-siteurls-config-siteurls-override-config-in-community-seAdding a Subdirectory to SiteUrls.config/SiteUrls_Override.config in Community Serverbinky2009-10-06T19:29:55Z2009-10-06T19:29:55Z
<p>I couldn't figure this out for the life of me, so I'm documenting it here.</p>
<p>When you want to add a subfolder, how do you do it?</p>
<p>Here is a folder off the root <code>/schedule/</code></p>
<pre><code><location name="schedule" path="/schedule/" themeDir="schedule">
<url name="schedule_default" path="schedule.aspx" pattern="schedule.aspx" physicalPath="##themeDir##" vanity="{2}" page="schedule.aspx" />
</location>
</code></pre>
<p>To make an entry for a subdirectory of /schedule, we need to make a separate entry. This entry is for <code>/schedule/stunts/</code></p>
<pre><code><location name="schedulestunts" path="/schedule/stunts/" themeDir="schedule/stunts">
<url name="schedule_stunt" path="ondemandfreepreview.aspx" pattern="ondemandfreepreview.aspx" vanity="{2}" physicalPath="##themeDir##" page="ondemandfreepreview.aspx" />
</location>
</code></pre>
<p>I don't know if this is the proper way to do this or not, but it got the job done. Please leave improvements if you have any!</p>
http://snippetgood.com/questions/44/community-server-redirection-with-siteurls-configCommunity Server Redirection with SiteUrls.configbinky2009-10-06T15:42:01Z2009-10-06T18:07:53Z
<p>It took me forever to figure out how to do this in CS 4, so I wanted to document what I did and see if anyone had any other suggestions to make this better:</p>
<p>The page is called stunt.aspx and it's physical location is <code>/themes/movies/content/stunt.aspx.</code> </p>
<p>The url it should display is <code>http://domain.com/content/stunt.aspx</code>, however a complication arises because the managers want to advertise the url as <code>http://domain.com/stunt.aspx</code> </p>
<p><strong>Make a Placeholder File</strong></p>
<p>The first step was to make a placeholder file in the root called <code>stunt.aspx</code></p>
<p>The page code looks like this (I copied it from another redirecting page):</p>
<pre><code><%@ Page %>
<%--
This page is a placeholder for URL rewriting.
--%>
</code></pre>
<p><strong>SiteUrls_Override.config</strong></p>
<p>In the SiteUrls<code>_</code>Override.config I added an entry to tell CS where the physical page was and what the short url should be. I store all of my /content/ definitions in SiteUrls_Override.config, but I think you could put it in SiteUrls.config if you're careful.</p>
<pre><code><location name="content" path="/content/" themeDir="content">
<url name="contentpart_stunt" path="stunt.aspx" pattern="stunt.aspx" vanity="{2}" physicalPath="##themeDir##" page="stunt.aspx" />
</location>
</code></pre>
<p><strong>SiteUrls.config</strong></p>
<p>In the SiteUrls.config, under the section for root pages, <code><location name="common" path="/" themeDir="common" ></code>, I added this entry:</p>
<pre><code><url name="redirect_stunt" path="/" pattern="stunt.aspx" vanity="{2}" redirect="true" physicalPath="/content/" page="stunt.aspx" />
</code></pre>
<p><strong>Important pieces in this line</strong></p>
<pre><code>redirect="true"
physicalPath="/content/"
</code></pre>
<p>these lines tell it to redirect and where to.</p>
<p><em>More Info:</em>
<a href="http://docs.communityserver.com/customization/understanding-the-siteurls-config-file/" rel="nofollow">http://docs.communityserver.com/customization/understanding-the-siteurls-config-file/</a> </p>