New Method Of Protection

Discussion in 'Setting-up protection' started by alex-adm, Apr 15, 2003.

Thread Status:
Not open for further replies.
  1. alex-adm

    alex-adm Guest

    Seems we found easy way to protect your HTML files with php_include plugin.
    It may not work on some hosting servers.....

    1. Put file into your protected directory and name it "protect.inc.php":
    Code:
    $_product_id = array(1,2,3); // actual product numbers which allow access to this directory
    include '../amember/plugins/protect/php_include/check.inc.php'; // relative or absolute filessystem path
    
    2. Put the following .htaccess file into your protected directory:
    Code:
    AddType application/x-httpd-php .html
    php_value auto_prepend_file protect.inc.php
    
    Try access HTML file in this directory. It should display you login page.

    As well as php_include protection, this method is not useful for protecting image or downloadable files. It will protect
    only HTML files.
  2. joe

    joe Guest

    place an index.php file in the image dir. that may not be protected as
    Alex stated above.

    :blink:

    Add this line:

    <?php

    /* replace yourdomain.com with the URL you want them returned to. */

    header("Location:http://www.yourdomain.com/");
    ?>


    Subbmission of this suggestion implies no guarentee's or warrantys of
    any kind. ( sides I am too poor to sue ) :lol:

    Best
  3. claridgep

    claridgep Guest

    Does this .htaccess file therefore replace the one that we are told to set up in the htpasswd section of set-up?

    Also, how can I test if the directory is protected given that once I have set up a dummy account for testing, I have a cookie and therefore go straight to the 'protected area'?

    Thanks,

    Peter
  4. alex-adm

    alex-adm Guest

    Yes, it does replace.

    To check - you have to click Logout on amember/member.php page.
  5. I checked the directories you protected on set up and have found nothing in them as an example. So - when you say to put this

    AddType application/x-httpd-php .html
    php_value auto_prepend_file protect.inc.php

    into a directory - how are you doig it? Text file - html what? And then placing that file into the folder requiring protection?
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes you must create .htaccess file with that text in your protected folder
  7. I will do it and I am sure itwill work if you say so, but the folders you protected when youset it up have nothing in them. I checked specifically because I thought there would be and I could use them as an example.
  8. Thanks - they show wth the host web interface - but not with ftp. Please disregard the question :blink:
Thread Status:
Not open for further replies.

Share This Page