title: Allow access to page only from certain referrer
body: <p>Include attempted solutions, why they didn't work, and the expected results. </p>
  
  <p>Hi there. I want to make a certain page on my website eg. site.com/content/B.html accessible only if you click the link that points to site.com/content/B.php from a specific page on the site eg. site.com/A.html</p>
  
  <p>What I have tried to do so far is putting this code in a .htaccess file inside site.com/content:</p>
  
  <pre><code>    RewriteCond %{HTTP_REFERER} !^http://www.site.com/A.html$
      RewriteRule B.php - [F,NC]
  </code></pre>
  
  <p>This was supposed to return a 403 error only if you tried to open site.com/content/B.php using a link from some other site or just typing site.com/content/B.php into the address bar of the browser, but instead it returns a 403 error when opening it from site.com/A.html as well.</p>
  
  <p>I expected for it to return a 403 error if opened from a different location, and for it to display B.php if opened from A.html</p>
  
  <p>I hope that you follow and I would really appreciate some advice.
  Thank you in advance.</p>