Skip to main content
Tweeted twitter.com/StackWebmasters/status/1072778221345746944
remove solution from question, answer is where it belongs
Source Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

UPDATE: Thanks guys. I've got it working by adding this rule RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www-patchworkoftips-com.cdn.ampproject.org [NC]. All is well.....for now. lol

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

UPDATE: Thanks guys. I've got it working by adding this rule RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www-patchworkoftips-com.cdn.ampproject.org [NC]. All is well.....for now. lol

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

problem solved
Source Link

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

UPDATE: Thanks guys. I've got it working by adding this rule RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www-patchworkoftips-com.cdn.ampproject.org [NC]. All is well.....for now. lol

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

UPDATE: Thanks guys. I've got it working by adding this rule RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www-patchworkoftips-com.cdn.ampproject.org [NC]. All is well.....for now. lol

added 93 characters in body; edited tags; edited title
Source Link

Hotlink Protection That Allows All Top Level Domains In googlecompatible with Google AMP pages

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

Hotlink Protection That Allows All Top Level Domains In google

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

Hotlink Protection compatible with Google AMP pages

I'm trying to create HTACCESS Hotlink Protection on my site but I'd like all Google top level domains (.com., .co.in, .co.uk, etc) to be able to access my files, so that visitors to the Google AMP version of my pages can view linked images and resources.

I tried the following in my htaccess but it's blocking Google AMP users

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !.*google.*  [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?patchworkoftips.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds.feedburner.com [NC]

RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com [NC]

RewriteRule \.(jpg|jpeg|gif|png|bmp|iso|zip|mp4|exe|xlsx|img|rar|apk|bar|7z|ipd)$ https://i.ibb.co/2hcQgZw/stop-hotlinking-images.jpg [NC,R,L]

For example, the URL for my Google AMP page starts with www.google.com.ng/amp/s/ and when users of such pages click to download a file they get an error image.

Anybody accessing the site directly from the main domain www.patchworkoftips.com can easily download the file.

I added RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com.ng [NC] but it doesn't seem to work either for some reason

I saw someone mention RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.*$/.*$but someone replied that this would give access to sites like "googlefake.com", "google123.es"

So the question here is how can I enable file download access for users landing on the Google AMP pages on my site and what would be the best way to achieve this for all google TLDs without clogging the htaccess file.

more detailed information
Source Link
Loading
Remove fluff, add tags
Source Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364
Loading
Source Link
Loading