Mod_Write, PHP_Include and Zip Files

Discussion in 'Setting-up protection' started by Brian, Feb 4, 2004.

  1. Brian

    Brian Guest

    Here is a quick question on something I am having trouble with.

    I have been using .htaccess for 1 year now. And it works great and have never had any problems with it.

    Now that the User:password@domain.com is not going to be supported any more, since the IE 6 security patch will disable this URL type, I am wanting to move my protection to PHP_Include with MOD_Write. My server supports it.

    I have pages and zip files that I am protecting.

    I tested one product with Mod_Write PHP_Include, and it seems to work fine. The web browser DOES get forwarded to the proper product URL to the zip file. I.E.: www.site.com/download/file.zip

    The only problem is, the zip file gets printed to the page, instead of giving a download option. I am guessing this is a header/mime type problem. But I don't know how to fix it.

    My .htaccess file looks like this:
    --------------------------------
    RewriteEngine On
    RewriteRule ^(.*)$ /plugins/protect/php_include/rewrite.php
    --------------------------------

    (I do not need to include the /amember/ in the path above, becasue my domain is http://amember.site.com)


    I have turned on plugin PHP_INCLUDE

    Note: I do not have a php page. Just a link to zip file that is setup for this product.

    I did however find this in the rewrite.php file:

    If your content contains something except HTML, JPG, GIF and PNG images,
    customize the code in bottom of this file to send correct headers to
    client browser.

    I understand this, but the "bottom" of the page contains the following already in it: Its a huge list of different mime types. And zip is already in it, So I guess I don't have to add anything to it.

    -------------------------------------
    $common_mime_types = array(
    "exe" => "application/octet-stream",
    "zip" => "application/zip",
    "plus" => "many more types";
    );

    if (($uri=rewrite_run_main())) virtual($uri);
    ?>

    -------------------------------------

    Anyways, just in case you forgot my original question:

    When a user clicks the link inside the member.php page, to their active product, which is a zip file, it gets printed to the screen, instead of giving a pop-up download options box. Any fix to this?

    Any help, tips or tricks would be appreciated.
  2. Brian

    Brian Guest

    Fixed!

    If you are experincing this problem, you will have to email support and ask them for the updated rewrite.php file.

    Alex emailed me a new rewrite.php file and I upload it and it seems to work fine now.
  3. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    It is enough to just get file
    amember/plugins/protect/php_include/rewrite.php
    from latest version of aMember (available from members area)

Share This Page