1

Hello there once again...

I came up with an strange idea but I have no clue if it's possible to do it.

Let's say that I have, 2 html pages. First (index.html) contain a button somewhere. The button serves to proceed on second page (proceed.html).

Basically... I want somehow to prohibit direct access such as copy/paste or access from history... And to allow only access to the page by click on specified button from index.html.

Is there any possibility to make this ? Jquery cookie or .htaccess? Thank you for your time.

dvlden
  • 2,402
  • 8
  • 38
  • 61

1 Answers1

2

I think there are several ways to achieve this. You could check for the http-referrer, and only allow access if the user comes from your first page. This can be done with .htaccess (as it is often used to prevent image-hotlinking). Look at this example as a starting point:
http://altlab.com/htaccess_tutorial.html

Off course you can also check the referrer server-side, when using PHP/Python/whatever.

Or, as a second approach - load the proceed.html via jQuery and make sure that it only allows access if the request is done through ajax. Also here you can check this with different techniques.
See this question for more information: Deny ajax file access using htaccess

Apache example:

SetEnvIfNoCase X-Requested-With XMLHttpRequest ajax
Order Deny,Allow
Deny from all
Allow from env=ajax
Community
  • 1
  • 1
ohrstrom
  • 2,890
  • 2
  • 20
  • 34