Hash :
c3ed5b52
Author :
Date :
2018-03-11T11:11:05
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
<h2>Comments</h2>
<pre><code># This is a comment
# <VirtualHost *:80>
</code></pre>
<h2>Directives</h2>
<pre><code><Files .htaccess>
Order allow,deny
Deny from all
</Files>
</code></pre>
<h2>Variables</h2>
<pre><code>RewriteCond %{REQUEST_FILENAME}.php -f</code></pre>
<h2>Regex</h2>
<pre><code>^(.*)$
!^www\.</code></pre>
<h2>Directive flags</h2>
<pre><code>[NC]
[RC=301,L]</code></pre>
<h2>Strings</h2>
<pre><code>AuthName "Fichiers réservés"</code></pre>
<h2>Full example</h2>
<pre><code>## BASIC PASSWORD PROTECTION
AuthType basic
AuthName "prompt"
AuthUserFile /.htpasswd
AuthGroupFile /dev/null
Require valid-user
## ALLOW FROM IP OR VALID PASSWORD
Require valid-user
Allow from 192.168.1.23
Satisfy Any
## PROTECT FILES
Order Allow,Deny
Deny from all
## REQUIRE SUBDOMAIN
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^subdomain\.domain\.tld$ [NC]
RewriteRule ^/(.*)$ http://subdomain.domain.tld/$1 [L,R=301]
ErrorDocument 403 http://www.example.com/logo.gif
ErrorDocument 403 /images/you_bad_hotlinker.gif
## REDIRECT UPLOADS
RewriteCond %{REQUEST_METHOD} ^(PUT|POST)$ [NC]
RewriteRule ^(.*)$ /cgi-bin/form-upload-processor.cgi?p=$1 [L,QSA]</code></pre>