• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Access file only through specific website?

Turkish

Lifer
I have an html file which I want to close to public access and make it available only through clicking on a link on another specific page.

So for example:

Page in question: *****/1.html or php

I want to make sure people cannot just type in the address for it and view it but rather I want them to go to *****/2.html and click on <a href="*****/1.html>Click</a> to view it.

I guess I could do prohibit hotlinking but what I am looking for is to disable viewing the page by typing the URL on address bar.

Is this possible? Thanks 🙂
 
I tried this but get a parse error on line 7.

<?php
define('ALLOWED_REFERRER', 'allowed referrer url');

if (ALLOWED_REFERRER !== ''
&& (!isset($_SERVER['HTTP_REFERER']) || strpos(strtoupper($_SERVER['HTTP_REFERER']),strtoupper(ALLOWED_REFERRER)) === false)
) {
die("Internal server error. Please contact system administrator.");
}

//rest of the code
?>

Any ideas?

edit: nevermind, got it.
 
Back
Top