snipt

Ctrl+h for KB shortcuts

Bash

create multiple directories in unix

mkdir -p domain.com/{public,private,log,cgi-bin,backup}
https://snipt.net/embed/91f18b0263eb25343da69bbb9c22f1ef/
/raw/91f18b0263eb25343da69bbb9c22f1ef/
91f18b0263eb25343da69bbb9c22f1ef
bash
Bash
1
2019-06-07T09:14:32
True
False
False
/api/public/snipt/3476/
create-multiple-directories-in-unix
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>mkdir -p domain.com/<span class="o">{</span>public,private,log,cgi-bin,backup<span class="o">}</span> </span></pre></div> </td></tr></table>
apache, bash, nginx, unix

ApacheConf

redirect www traffic to non-www domain dynamically with multiple domains in same virtualhost

1
2
3
4
# Redirect www to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [L,R=301]
https://snipt.net/embed/e0c21793a83cfd9c295fb51f2dad4dba/
/raw/e0c21793a83cfd9c295fb51f2dad4dba/
e0c21793a83cfd9c295fb51f2dad4dba
apacheconf
ApacheConf
4
2019-06-11T18:34:51
True
False
False
/api/public/snipt/2588/
redirect-www-traffic-to-non-www-domain-dynamically-with-multiple-domains-in-same-virtualhost
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c"># Redirect www to non-www</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">RewriteEngine</span> <span class="k">on</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">RewriteCond</span> %{HTTP_HOST} ^www\.(.+)$ [NC] </span><span id="L-4"><a name="L-4"></a><span class="nb">RewriteRule</span> ^(.*)$ http://%1$1 [L,R=301] </span></pre></div> </td></tr></table>
apache, mod_rewrite, virtualhost

ApacheConf

disable expires header for files ending in txt for using mint with drupal

1
2
3
<FilesMatch "\.(txt)$">
  ExpiresActive Off
</FilesMatch>
https://snipt.net/embed/56bff77530007eac2cb2464bb8b2e253/
/raw/56bff77530007eac2cb2464bb8b2e253/
56bff77530007eac2cb2464bb8b2e253
apacheconf
ApacheConf
3
2019-05-23T10:51:17
True
False
False
/api/public/snipt/2376/
disable-expires-header-for-files-ending-in-txt-for-using-mint-with-drupal
<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><span class="nt">&lt;FilesMatch</span> <span class="s">&quot;\.(txt)$&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">ExpiresActive</span> <span class="k">Off</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">&lt;/FilesMatch&gt;</span> </span></pre></div> </td></tr></table>
apache, drupal, htaccess, mint

Bash

name of httpd include

httpd.include
https://snipt.net/embed/53720059843851fbdda8c00290708cf1/
/raw/53720059843851fbdda8c00290708cf1/
53720059843851fbdda8c00290708cf1
bash
Bash
1
2019-06-03T00:27:20
True
False
False
/api/public/snipt/2311/
name-of-httpd-include
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>httpd.include </span></pre></div> </td></tr></table>
apache