Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Quitar el .html de las urls por htaccess

1
2
3
#### Para quitar el .html de las urls
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
https://snipt.net/embed/ecacb9d931e0410ca9d5e738019a210a/
https://snipt.net/raw/ecacb9d931e0410ca9d5e738019a210a/
ecacb9d931e0410ca9d5e738019a210a
text
Text only
3
2016-12-02T11:05:27
True
False
False
Sep 30, 2015 at 10:01 AM
/api/public/snipt/141324/
quitar-el-html-de-las-urls-por-htaccess
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>#### Para quitar el .html de las urls </span><span id="L-2"><a name="L-2"></a>RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/ </span><span id="L-3"><a name="L-3"></a>RewriteRule ^(.*)\.html$ /$1 [R=301,L] </span></pre></div> </td></tr></table>
htaccess, url

Text only

Rewrite Xmap URL

1
2
3
4
5
6
RewriteCond %{REQUEST_URI} ^/es/sitemap.xml
RewriteRule .* /es/index.php?option=com_xmap&view=xml&tmpl=component&id=1
RewriteCond %{REQUEST_URI} ^/en/sitemap.xml
RewriteRule .* /en/index.php?option=com_xmap&view=xml&tmpl=component&id=2
RewriteCond %{REQUEST_URI} ^/pt/sitemap.xml
RewriteRule .* /pt/index.php?option=com_xmap&view=xml&tmpl=component&id=3
https://snipt.net/embed/29b62e0c11755e05065242cf9fcd3991/
https://snipt.net/raw/29b62e0c11755e05065242cf9fcd3991/
29b62e0c11755e05065242cf9fcd3991
text
Text only
6
2016-12-02T11:05:41
True
False
False
Apr 01, 2014 at 11:48 AM
/api/public/snipt/126512/
rewrite-xmap-url
<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>RewriteCond %{REQUEST_URI} ^/es/sitemap.xml </span><span id="L-2"><a name="L-2"></a>RewriteRule .* /es/index.php?option=com_xmap&amp;view=xml&amp;tmpl=component&amp;id=1 </span><span id="L-3"><a name="L-3"></a>RewriteCond %{REQUEST_URI} ^/en/sitemap.xml </span><span id="L-4"><a name="L-4"></a>RewriteRule .* /en/index.php?option=com_xmap&amp;view=xml&amp;tmpl=component&amp;id=2 </span><span id="L-5"><a name="L-5"></a>RewriteCond %{REQUEST_URI} ^/pt/sitemap.xml </span><span id="L-6"><a name="L-6"></a>RewriteRule .* /pt/index.php?option=com_xmap&amp;view=xml&amp;tmpl=component&amp;id=3 </span></pre></div> </td></tr></table>
htaccess, joomla, rewrite, sitemap, xmap

Text only

.htaccess Gzip Compression

1
2
3
4
5
# BEGIN GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
# END GZIP
https://snipt.net/embed/31208984d23e86248954e9a43d8214b9/
https://snipt.net/raw/31208984d23e86248954e9a43d8214b9/
31208984d23e86248954e9a43d8214b9
text
Text only
5
2016-12-02T10:58:37
True
False
False
/api/public/snipt/122411/
htaccess-gzip-compression-1
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a># BEGIN GZIP </span><span id="L-2"><a name="L-2"></a>&lt;ifmodule mod_deflate.c&gt; </span><span id="L-3"><a name="L-3"></a>AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </span><span id="L-4"><a name="L-4"></a>&lt;/ifmodule&gt; </span><span id="L-5"><a name="L-5"></a># END GZIP </span></pre></div> </td></tr></table>
gzip, htaccess

ApacheConf

HTACCESS - File Name and File Type Conditions

1
2
3
4
5
6
# Don't redirect these files
RewriteCond %{REQUEST_URI} !(page1|page_one|page_one_1)\.html$
# Don't redirect these file types
RewriteCond %{REQUEST_FILENAME} !\.(css|js|xml|jpg|png|gif|eot|woff|ttf)$
# Redirect everything else
RewriteRule ^(.*)$ http://%{HTTP_HOST}/newpage.html [R=301,L]
https://snipt.net/embed/16c83996f079b1553da1c6d3f7324472/
https://snipt.net/raw/16c83996f079b1553da1c6d3f7324472/
16c83996f079b1553da1c6d3f7324472
apacheconf
ApacheConf
6
2016-12-03T10:57:44
True
False
False
/api/public/snipt/115787/
htaccess-filename-and-file-type-conditions
<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><span class="c"># Don&#39;t redirect these files</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">RewriteCond</span> %{REQUEST_URI} !(page1|page_one|page_one_1)\.html$ </span><span id="L-3"><a name="L-3"></a><span class="c"># Don&#39;t redirect these file types</span> </span><span id="L-4"><a name="L-4"></a><span class="nb">RewriteCond</span> %{REQUEST_FILENAME} !\.(css|js|xml|jpg|png|gif|eot|woff|ttf)$ </span><span id="L-5"><a name="L-5"></a><span class="c"># Redirect everything else</span> </span><span id="L-6"><a name="L-6"></a><span class="nb">RewriteRule</span> ^(.*)$ http://%{HTTP_HOST}/newpage.html [R=301,L] </span></pre></div> </td></tr></table>
htaccess
Copyrighted, illegal, or inappropriate content? Email [email protected].