php - htaccess

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Geradeaus

    php - htaccess

    On my webhosting I don't have access to a root directory, so I am stuck in
    the public folder.

    I should secure the downloads folder, this is why I wanted to use a
    ..htaccess file.

    Only, PHP should have access to this folder..because users login using a
    username and password from the database.

    How can I make an htaccess file which allows the "php-user" to access the
    files in the folder on a Linux webserver?

    Thanks in advance!
    Ben


  • Dmitry Lukashin

    #2
    Re: php - htaccess

    PHP read files directly from filesystem, .htaccess can't deny access for PHP

    On 2005-06-07, Geradeaus <gehegeradeaus@ hotmail.com> wrote:[color=blue]
    > On my webhosting I don't have access to a root directory, so I am stuck in
    > the public folder.
    >
    > I should secure the downloads folder, this is why I wanted to use a
    > .htaccess file.
    >
    > Only, PHP should have access to this folder..because users login using a
    > username and password from the database.
    >
    > How can I make an htaccess file which allows the "php-user" to access the
    > files in the folder on a Linux webserver?
    >
    > Thanks in advance!
    > Ben
    >[/color]

    Comment

    • chotiwallah

      #3
      Re: php - htaccess

      if i understand right you want to prevent people from downloading via a
      direct link in your download dir. two ways to prevent that:

      1. put your downloads in a database

      2. use .htaccess to deny any http access to download dir and have php
      read and deliver the downloads via the file system (which is not
      affected by .htaccess, as dmitry wrote already), using i. e. readfile()

      micha

      Comment

      • Geradeaus

        #4
        Re: php - htaccess


        "chotiwalla h" <chotiwallah@we b.de> schreef in bericht
        news:1118216549 .071878.23350@g 49g2000cwa.goog legroups.com...[color=blue]
        > if i understand right you want to prevent people from downloading via a
        > direct link in your download dir. two ways to prevent that:
        >
        > 1. put your downloads in a database
        >
        > 2. use .htaccess to deny any http access to download dir and have php
        > read and deliver the downloads via the file system (which is not
        > affected by .htaccess, as dmitry wrote already), using i. e. readfile()
        >
        > micha[/color]

        thanks for your advice, how could I not think about that...


        Comment

        Working...