snipt

Ctrl+h for KB shortcuts

Bash

Compress font files for use with @font-face

1
2
3
4
5
6
# Compress font files for use with @font-face
Addtype font/opentype .otf
Addtype font/truetype .ttf
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css font/opentype font/truetype

# Comments: Both these declarations require their appropriate modules to be active: mod_mime and mod_deflate. And for best practice, the AddType declaration should be in the mime.conf file, and the AddOutputFilterByType declaration should be in the deflate.conf file. See your particular distribution's help files for enabling and configuring Apache modules.
https://snipt.net/embed/c84599fafe2526ca8e7e05460b94827d/
/raw/c84599fafe2526ca8e7e05460b94827d/
c84599fafe2526ca8e7e05460b94827d
bash
Bash
6
2019-06-17T17:34:23
True
False
False
/api/public/snipt/9204/
compress-font-files-for-use-with-font-face
<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="c1"># Compress font files for use with @font-face</span> </span><span id="L-2"><a name="L-2"></a>Addtype font/opentype .otf </span><span id="L-3"><a name="L-3"></a>Addtype font/truetype .ttf </span><span id="L-4"><a name="L-4"></a>AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css font/opentype font/truetype </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="c1"># Comments: Both these declarations require their appropriate modules to be active: mod_mime and mod_deflate. And for best practice, the AddType declaration should be in the mime.conf file, and the AddOutputFilterByType declaration should be in the deflate.conf file. See your particular distribution&#39;s help files for enabling and configuring Apache modules.</span> </span></pre></div> </td></tr></table>
@font-face, compress, fonts, gzip, htaccess

Text only

Uniserver mod rewrite enabled

1
2
3
4
5
6
Uniserver mod rewrite

Put this at the end of the .htaccess file located in /udrive/www/

Options +FollowSymLinks
RewriteEngine On
https://snipt.net/embed/4ed026ecbeb46f7d5f42c57d842a110c/
/raw/4ed026ecbeb46f7d5f42c57d842a110c/
4ed026ecbeb46f7d5f42c57d842a110c
text
Text only
6
2019-06-18T04:33:47
True
False
False
/api/public/snipt/8948/
uniserver-mod-rewrite-enabled
<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>Uniserver mod rewrite </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>Put this at the end of the .htaccess file located in /udrive/www/ </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>Options +FollowSymLinks </span><span id="L-6"><a name="L-6"></a>RewriteEngine On </span></pre></div> </td></tr></table>
htaccess, modrewrite, uniserver

Text only

Design max upload size

1
2
3
php_value upload_max_filesize 8M

 - www.bluecubemedia.co.uk
https://snipt.net/embed/262e1a89cf124b4a2ff253e64ebb28f9/
/raw/262e1a89cf124b4a2ff253e64ebb28f9/
262e1a89cf124b4a2ff253e64ebb28f9
text
Text only
3
2019-06-15T22:39:38
True
False
False
/api/public/snipt/7869/
design-max-upload-size
<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>php_value upload_max_filesize 8M </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a> - www.bluecubemedia.co.uk </span></pre></div> </td></tr></table>
"file size", htaccess, server, upload

ApacheConf

html as php .htaccess

# let html files act as php files
AddType application/x-httpd-php .php .htm .html
https://snipt.net/embed/698c37adef0ff16894027e9c95e194e5/
/raw/698c37adef0ff16894027e9c95e194e5/
698c37adef0ff16894027e9c95e194e5
apacheconf
ApacheConf
3
2019-06-09T03:25:13
True
False
False
/api/public/snipt/7754/
html-as-php-htaccess
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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"># let html files act as php files</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">AddType</span> application/x-httpd-php .php .htm .html </span></pre></div> </td></tr></table>
htaccess

ApacheConf

base .htaccess (rewrite)

1
2
3
Options +FollowSymLinks

RewriteEngine On
https://snipt.net/embed/75b2ad1bffd47f27b1f501dfcbfa4105/
/raw/75b2ad1bffd47f27b1f501dfcbfa4105/
75b2ad1bffd47f27b1f501dfcbfa4105
apacheconf
ApacheConf
4
2019-06-12T14:48:16
True
False
False
/api/public/snipt/7753/
base-htaccess-rewrite
<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="nb">Options</span> +FollowSymLinks </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nb">RewriteEngine</span> <span class="k">On</span> </span></pre></div> </td></tr></table>
htaccess

ApacheConf

pooper snooper

# prevent open directories from browsing
Options All -Indexes
https://snipt.net/embed/6ddbc20607c79c5498028423117de896/
/raw/6ddbc20607c79c5498028423117de896/
6ddbc20607c79c5498028423117de896
apacheconf
ApacheConf
2
2019-05-24T18:21:25
True
False
False
/api/public/snipt/7752/
pooper-snooper
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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"># prevent open directories from browsing</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">Options</span> <span class="k">All</span> -Indexes </span></pre></div> </td></tr></table>
htaccess