Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Disable Hotlinking (HTACCESS) Some questions! |
|
Author |
|
dke
Joined: 13 Jul 2007 Posts: 61 Location: sweden
|
Posted: Wed 18 Jan '12 16:06 Post subject: Disable Hotlinking (HTACCESS) Some questions! |
|
|
Hi,
I wonder how to make sure that hotlinking works from all domains with different ending names.
Like google, they have .com .org .nu etc, i want to make sure that all google links are able to be hotlinked.
current code:
Code: | RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mydomain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?google\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://imgur.com/nohotlinkingplease.jpg [L] |
Can i replace .com/ with .*/ to enable all?
Thanks. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Thu 19 Jan '12 17:25 Post subject: |
|
|
I'm not sure if it is just the asteric * or (.*)
See
Code: |
Text:
. Any single character
[chars] One of chars
[^chars] None of chars
text1|text2 text1 or text2
Quantifiers:
? 0 or 1 of the preceding text
* 0 or N of the preceding text (N > 0)
+ 1 or N of the preceding text (N > 1)
Grouping:
(text) Grouping of text
Anchors:
^ Start of line anchor
$ End of line anchor
Escaping:
\ char escape that particular char
|
|
|
Back to top |
|
|
|
|
|
|