Web Page Protection

liunx

Guest
Hi all,<br />
<br />
Question. I can protect a directory on my web site useing .htaccess but can I protect the same directory but only allow access which comes form a fixed URL without the server asking for the login ID and password.<br />
<br />
Does this make any sense, I hope so.<br />
<br />
Can anyone advise please<br />
<br />
Thanks in advance<br />
<br />
Keep safe and well<br />
<br />
Dereck<!--content-->Can anyone help with this post<br />
<br />
Many thanks<br />
<br />
Dereck<!--content-->Yes you can. I would not know how to do it with a client side script (It would also not be secure, a user can view your source to get the url) But with a server side languge it is possible. In asp.net it would look like this<br />
<br />
if request.ServerVariables("HTTP_REFERER") <> "theurlyouwant" then<br />
response.Redirect("anotherpage")<br />
end if<!--content-->PeOfEo <br />
<br />
Thanks for your reply. I will have a look at implementing<br />
your reply useing php.<br />
<br />
Thanks<br />
<br />
Keep safe and well<br />
<br />
Regards<br />
<br />
dereck<!--content--><?PHP<br />
if ($_SERVER["HTTP_REFERER"] == "http://www.yourdoamin.com/somepage.php") {<br />
header("Location:http://www.php.net");<br />
}<br />
?>Must be set before any code is sent to the browser, including <html> etc...<!--content-->pyro <br />
<br />
Thanks for that, you are a star.<br />
<br />
Keep safe and well<br />
<br />
Regards<br />
<br />
dereck<!--content-->You're welcome... :)<!--content-->
 
Back
Top