Web Hosting Talk







View Full Version : How to block direct access to a web page in ASP.Net


skakakhel
09-04-2005, 06:39 AM
Hi all

I'm relatively new around here and not sure where this post would fit in. Please move it if its not in the right forum.

Anyways, I desperately need your help ppl, I'm working on a web development project in ASP.Net. Can anyone please tell me how to block direct access of certain web pages from the address bar? For example pages other than the index or home page.

Thanks in advance

azizny
09-04-2005, 03:49 PM
you will have to be using htaccess for such thing..

try searching google for htacces+access..

Peace,

Padwah
09-05-2005, 06:05 PM
not entirely sure how to do it .net but in vanilla ASP you could alwasy just check for a referer for your domain and if it isn't there you just redirect them to the front page or to where ever you like actually!


<%
if instr(request.ServerVariables("HTTP_REFERER"), "yourdomain.com") = 0 then
response.redirect("yourdomain.com")
end if
%>