allow access to a HTML page only if the user comes from a specific url with htaccess
I need help with htaccess
I want allow access to a page only if the user comes from a specific url
A website with two HTML pages, A and B.
Both can be accessed by typing the URL, of course.
However, can I disallow any access to page B, and only allow it if the user is coming from page A? As in, a link in page A that redirects to page B.
is this possible even if page A is in a different directory than page b?
I found this snippet of code but it gives me an 500 internal server error
Code:
RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com/A.html$
RewriteRule B.html - [F,NC]
thank you for help