Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

C#

Making use of rewritemaps.config

1
2
3
4
5
6
7
<system.webserver>
  <rewrite>
    <rules>
      <rewriteMaps configSource="rewritemaps.config" />
    </rules>
  </rewrite>
</system.webserver>
https://snipt.net/embed/d9f035d8600541498c21621a39cbb0ba/
https://snipt.net/raw/d9f035d8600541498c21621a39cbb0ba/
d9f035d8600541498c21621a39cbb0ba
csharp
C#
7
2016-10-26T06:27:14
True
False
True
Jan 12, 2013 at 04:18 PM
/api/public/snipt/53118/
making-use-of-rewritemapsconfig
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="p">&lt;</span><span class="n">system</span><span class="p">.</span><span class="n">webserver</span><span class="p">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="p">&lt;</span><span class="n">rewrite</span><span class="p">&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="p">&lt;</span><span class="n">rules</span><span class="p">&gt;</span> </span><span id="L-4"><a name="L-4"></a> <span class="p">&lt;</span><span class="n">rewriteMaps</span> <span class="n">configSource</span><span class="p">=</span><span class="s">&quot;rewritemaps.config&quot;</span> <span class="p">/&gt;</span> </span><span id="L-5"><a name="L-5"></a> <span class="p">&lt;/</span><span class="n">rules</span><span class="p">&gt;</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">&lt;/</span><span class="n">rewrite</span><span class="p">&gt;</span> </span><span id="L-7"><a name="L-7"></a><span class="p">&lt;/</span><span class="n">system</span><span class="p">.</span><span class="n">webserver</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
asp.net, c#, rewritemaps.config, web.config

Text only

Umbraco WWW Redirect

1
2
3
4
5
6
7
<add name="seoCanonical"
        virtualUrl="http://domain.com/(.*)"
        rewriteUrlParameter="ExcludeFromClientQueryString"
        destinationUrl="http://www.domain.com/$1"
        redirect="Domain"
        redirectMode="Permanent"
        ignoreCase="true" />
https://snipt.net/embed/d8063f4cda1b2f0d8feef92ad4af3d0b/
https://snipt.net/raw/d8063f4cda1b2f0d8feef92ad4af3d0b/
d8063f4cda1b2f0d8feef92ad4af3d0b
text
Text only
7
2016-12-10T07:41:51
True
False
False
/api/public/snipt/29001/
umbraco-www-redirect
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;add name=&quot;seoCanonical&quot; </span><span id="L-2"><a name="L-2"></a> virtualUrl=&quot;http://domain.com/(.*)&quot; </span><span id="L-3"><a name="L-3"></a> rewriteUrlParameter=&quot;ExcludeFromClientQueryString&quot; </span><span id="L-4"><a name="L-4"></a> destinationUrl=&quot;http://www.domain.com/$1&quot; </span><span id="L-5"><a name="L-5"></a> redirect=&quot;Domain&quot; </span><span id="L-6"><a name="L-6"></a> redirectMode=&quot;Permanent&quot; </span><span id="L-7"><a name="L-7"></a> ignoreCase=&quot;true&quot; /&gt; </span></pre></div> </td></tr></table>
umbraco, web.config

Text only

web.config Page Specific Redirect

1
2
3
4
5
6
<rewrite>  
  <rule name="pageRedirect1" stopProcessing="true">
     <match url="^old-page\.html" ignoreCase="false" />
     <action type="Redirect" redirectType="Permanent" url="http://www.domain.com/new-page.aspx" />
  </rule>
</rewrite>
https://snipt.net/embed/afc2b9cdad505167bbdf45129215527d/
https://snipt.net/raw/afc2b9cdad505167bbdf45129215527d/
afc2b9cdad505167bbdf45129215527d
text
Text only
6
2016-12-10T07:41:20
True
False
False
/api/public/snipt/28996/
webconfig-page-specific-redirect
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;rewrite&gt; </span><span id="L-2"><a name="L-2"></a> &lt;rule name=&quot;pageRedirect1&quot; stopProcessing=&quot;true&quot;&gt; </span><span id="L-3"><a name="L-3"></a> &lt;match url=&quot;^old-page\.html&quot; ignoreCase=&quot;false&quot; /&gt; </span><span id="L-4"><a name="L-4"></a> &lt;action type=&quot;Redirect&quot; redirectType=&quot;Permanent&quot; url=&quot;http://www.domain.com/new-page.aspx&quot; /&gt; </span><span id="L-5"><a name="L-5"></a> &lt;/rule&gt; </span><span id="L-6"><a name="L-6"></a>&lt;/rewrite&gt; </span></pre></div> </td></tr></table>
web.config
Copyrighted, illegal, or inappropriate content? Email [email protected].