mirror of
https://github.com/phanan/htaccess.git
synced 2018-11-08 13:39:40 +01:00
Compact patterns for matching images
Trim trailing white spaces
This commit is contained in:
parent
edd093473e
commit
6e3ca17b74
14
README.md
14
README.md
@ -242,25 +242,25 @@ RewriteEngine on
|
|||||||
# Remove the following line if you want to block blank referrer too
|
# Remove the following line if you want to block blank referrer too
|
||||||
RewriteCond %{HTTP_REFERER} !^$
|
RewriteCond %{HTTP_REFERER} !^$
|
||||||
|
|
||||||
RewriteCond %{HTTP_REFERER} !^http(s)?://(.+\.)?example.com [NC]
|
RewriteCond %{HTTP_REFERER} !^https?://(.+\.)?example.com [NC]
|
||||||
RewriteRule \.(jpg|jpeg|png|gif|bmp)$ - [NC,F,L]
|
RewriteRule \.(jpe?g|png|gif|bmp)$ - [NC,F,L]
|
||||||
|
|
||||||
# If you want to display a "blocked" banner in place of the hotlinked image,
|
# If you want to display a "blocked" banner in place of the hotlinked image,
|
||||||
# replace the above rule with:
|
# replace the above rule with:
|
||||||
# RewriteRule \.(jpg|jpeg|png|gif|bmp) http://example.com/blocked.png [R,L]
|
# RewriteRule \.(jpe?g|png|gif|bmp) http://example.com/blocked.png [R,L]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Disable Image Hotlinking for Specific Domains
|
### Disable Image Hotlinking for Specific Domains
|
||||||
Sometimes you want to disable image hotlinking from some bad guys only.
|
Sometimes you want to disable image hotlinking from some bad guys only.
|
||||||
``` apacheconf
|
``` apacheconf
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteCond %{HTTP_REFERER} ^http(s)?://(.+\.)?badsite\.com [NC,OR]
|
RewriteCond %{HTTP_REFERER} ^https?://(.+\.)?badsite\.com [NC,OR]
|
||||||
RewriteCond %{HTTP_REFERER} ^http(s)?://(.+\.)?badsite2\.com [NC,OR]
|
RewriteCond %{HTTP_REFERER} ^https?://(.+\.)?badsite2\.com [NC,OR]
|
||||||
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
|
RewriteRule \.(jpe?g|png|gif|bmp)$ - [NC,F,L]
|
||||||
|
|
||||||
# If you want to display a "blocked" banner in place of the hotlinked image,
|
# If you want to display a "blocked" banner in place of the hotlinked image,
|
||||||
# replace the above rule with:
|
# replace the above rule with:
|
||||||
# RewriteRule \.(jpg|jpeg|png|gif|bmp) http://example.com/blocked.png [R,L]
|
# RewriteRule \.(jpe?g|png|gif|bmp) http://example.com/blocked.png [R,L]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Password Protect a Directory
|
### Password Protect a Directory
|
||||||
|
Loading…
Reference in New Issue
Block a user