This seems to work as intended, but I'd like assurance that it works because it's correct as opposed to just working because, er, it happens to work:
RewriteCond %{HTTP_COOKIE} !cookiename=1
RewriteCond %{HTTP_REFERER} one-specific-page [OR]
RewriteCond %{REMOTE_ADDR} ^12\.34\. [OR]
RewriteCond %{HTTP_USER_AGENT} one-specific-UA
RewriteRule directory/page/(\w+\.html)?$ - [L,CO=cookiename:1:.example.com:43200]
RewriteCond %{HTTP_COOKIE} !cookiename=1
RewriteRule directory/page/(\w+\.html)?$ /boilerplate/sorry.html [L]
Intention: Low degree of privacy, not security. All pages in directory are flagged noindex. It would be very foolish to robot-out the directory, since bad robots would then know of its existence and make a beeline for it ;)
Accessible to people who:
have been there in the past month (60 x 24 x 30 = 43200)
OR arrive directly from one specific page
OR come from a particular IP range
OR, uhm, people who are me (UA exemption for one browser, UA spoofing isn't a concern).
Else:
rewrite (no 40x or 301) to error-type page which happens to be used only in this one situation, but I've worded it so it can be recycled for other analogous situations later
Have I got this right?