Does the meta tag no-referrer affect the way htaccess redirects and hot-link prevention process?

by Gary   Last Updated August 07, 2019 01:04 AM - source

I am trying to understand why the meta tag for no-referrer would interfere with the redirect and hot-link prevention in an htaccess file in a shared hosting environment on LiteSpeed.

For several days the host support couldn't get a redirect and hot-link prevention to both work at the same time. If the redirect worked, then any site could hot link the files. If the hot-link prevention worked then the redirect either wouldn't work or the site couldn't access its own files.

There are three domain names, name_1.org (the primary domain on the account), name_1.com, and name_2.com. The latter two domains are set up as add-on domains on the primary account. All three are being redirected to https://www.name_2.name_1.org, whether entered with or without the www.

The host support claims that the issue is due to my placing <meta name="referrer" content="no-referrer"> in the head of the HTML files. I must admit that removing it does result in the redirection and hot-link protection both working together. However, it makes no sense to me why the referrer information would affect either of these two items.

I made a local HTML page and placed the same meta tag in the head and the equivalent in a link to the sites files, and a link to the site pages using one of the URLs that requires redirection; and it all works fine. The redirection takes place and the files cannot be hot-linked.

Is there any reason why the referrer would affect these items? The redirection and hot-link code from the htaccess files is below. This htaccess file is at the public_html directory and the second block under public_html/name_2 directory. It looks overly messy to me but I'm pretty new to this area.

Thank you.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^name_1\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.name_1\.org$
RewriteCond %{HTTP_HOST} ^name_1\.org$ [OR]
RewriteCond %{HTTP_HOST} ^www\.name_1\.org$ [OR]
RewriteCond %{HTTP_HOST} ^name_1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.name_1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^name_2\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.name_2\.com$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.name_2.name_1\.org" [R=301,L]

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://name_2.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_2.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_2.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_2.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_1.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_1.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_1.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://name_1.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_2.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_2.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_2.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_2.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_1.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_1.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_1.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.name_1.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_2.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_2.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_2.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_2.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_1.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_1.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_1.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://name_1.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_2.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_2.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_2.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_2.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_1.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name1.com$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_1.org$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_1.name_1.org/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.name_1.name_1.org$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

In public_html/name_2 appears this code first and then a repeat of the hot_linking prevention code from above.

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$
RewriteCond %{HTTP_HOST} ^name_2\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.name_2\.com$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Sectigo\ DCV)?$
RewriteRule ^/?$ "https\:\/\/www\.name_2\.name_1\.org\  " [R=301,L]


Related Questions


Google Could Not Fetch Sitemap

Updated August 22, 2019 13:04 PM

How to add meta keywords in each Blogger post?

Updated August 23, 2015 20:01 PM


Should I use Meta Tags or Json-LD?

Updated May 02, 2018 11:04 AM

Meta title - include page name?

Updated December 04, 2017 16:04 PM