How do I prevent users from access a page by typing in the URL?

Discussion in 'Site Programming, Development and Design' started by SpottedTowhee, Mar 7, 2017.

  1. Hi everyone. I've been trying to prevent users from simply going directly to a page by typing it in the browser. I've read some and found references to .htaccess but this is an Apache feature. I then found that as Windows users we need to configure the WebConfig. I haven't been able to find webconfig and was wondering if there's another way to do this.

    Is there a way to prevent users from accessing a specific page by typing in the url? I am developing my pages with php and would appreciate any ideas for Wndows users.

  2. Thanks for helping! I can redirect if a user lands on a page where I want to control access but say I have a pdf file in a location http://MyWebLocation/thePdfFile.pdf. The user can just type in http://MyWebLocation/thePdfFile.pdf and have access the pdf file. I'm trying to prevent this from happening. I want them to get to the file only by clicking on the links that I offer on my site. Any ideas how I can accomplish this on my shared hosting site?

    Thanks again for getting back to me so quickly!
  3. It may be possible to do that by restricting access to a given directory by hostname. Meaning a visitor could only access the directory if they were coming from your site (since you want to link from your site to the file(s)).

    That's not prefect security, since someone could go to any page on your site and then enter the direct URL and access the file without following your link. But it may be as close as you can get to what you want to do.

    I know that's possible on the server level, but I'm not sure if you can set it up via IIS Manager...maybe one of the support staff can chime in here and let us know if it's possible for you to do it, or if it's possible for us to set it up for you.
  4. Elshadriel

    Elshadriel Winhost Staff

Share This Page