mirror of
https://github.com/phanan/htaccess.git
synced 2018-11-08 13:39:40 +01:00
Merge branch 'skilledDeveloper-master'
This commit is contained in:
commit
9caa4efbc1
22
README.md
22
README.md
@ -34,10 +34,13 @@ What we are doing here is mostly collecting useful snippets from all over the in
|
|||||||
- [Disable Image Hotlinking for Specific Domains](#disable-image-hotlinking-for-specific-domains)
|
- [Disable Image Hotlinking for Specific Domains](#disable-image-hotlinking-for-specific-domains)
|
||||||
- [Password Protect a Directory](#password-protect-a-directory)
|
- [Password Protect a Directory](#password-protect-a-directory)
|
||||||
- [Password Protect a File or Several Files](#password-protect-a-file-or-several-files)
|
- [Password Protect a File or Several Files](#password-protect-a-file-or-several-files)
|
||||||
|
- [Block Visitors by Referrer](#block-visitors-by-referrer)
|
||||||
|
- [Prevent Framing the Site](#prevent-framing-the-site)
|
||||||
- [Performance](#performance)
|
- [Performance](#performance)
|
||||||
- [Compress Text Files](#compress-text-files)
|
- [Compress Text Files](#compress-text-files)
|
||||||
- [Set Expires Headers](#set-expires-headers)
|
- [Set Expires Headers](#set-expires-headers)
|
||||||
- [Turn eTags Off](#turn-etags-off)
|
- [Turn eTags Off](#turn-etags-off)
|
||||||
|
- [Disable gzip Compression](#disable-gzip-compression)
|
||||||
- [Miscellaneous](#miscellaneous)
|
- [Miscellaneous](#miscellaneous)
|
||||||
- [Set PHP Variables](#set-php-variables)
|
- [Set PHP Variables](#set-php-variables)
|
||||||
- [Custom Error Pages](#custom-error-pages)
|
- [Custom Error Pages](#custom-error-pages)
|
||||||
@ -283,6 +286,24 @@ Require valid-user
|
|||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Block Visitors by Referrer
|
||||||
|
This denies access for all users who are coming from (referred by) a specific domain.
|
||||||
|
[Source](http://www.htaccess-guide.com/deny-visitors-by-referrer/)
|
||||||
|
``` apacheconf
|
||||||
|
RewriteEngine on
|
||||||
|
# Options +FollowSymlinks
|
||||||
|
RewriteCond %{HTTP_REFERER} somedomain\.com [NC,OR]
|
||||||
|
RewriteCond %{HTTP_REFERER} anotherdomain\.com
|
||||||
|
RewriteRule .* - [F]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Prevent Framing the Site
|
||||||
|
This prevents the website to be framed (i.e. put into an `iframe` tag), when still allows framing for a specific URI.
|
||||||
|
``` apacheconf
|
||||||
|
SetEnvIf Request_URI "/starry-night" allow_framing=true
|
||||||
|
Header set X-Frame-Options SAMEORIGIN env=!allow_framing
|
||||||
|
```
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
### Compress Text Files
|
### Compress Text Files
|
||||||
``` apacheconf
|
``` apacheconf
|
||||||
@ -390,7 +411,6 @@ By removing the ETag header, you disable caches and browsers from being able to
|
|||||||
FileETag None
|
FileETag None
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Miscellaneous
|
## Miscellaneous
|
||||||
|
|
||||||
### Set PHP Variables
|
### Set PHP Variables
|
||||||
|
Loading…
Reference in New Issue
Block a user