Hello. I’m running EE 1.6.7 and I’ve put a .zip file in my public root. I want to protect this .zip. I don’t have a member login feature on my site and I don’t have time just now to make a pretty login page as its suggested by Brandon Ballantine.
In the .htaccess scenario, my friend/colleague would click a link to that file in their email (ie. http://mysite.com/myfile.zip). The download/blank page would require a user/pass from browser-native request box. No styling, no html. I realize its not a pretty way to do this, but I just need one file protected.
So I used the .htpasswd generator at
Dynamic Drive.
Its straight-forward. I also put my .htpasswd file in the public root. I think my rewrite rule for index.php is messing things up. Linking to my secure file results in my 404 page.
My .htaccess file looks like this:
# BEGIN Expression Engine Rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteRule ^(.*)$ /index.php?$1 [L]
</IfModule>
# Secure portfolio download <a href="http://tools.dynamicdrive.com/password/">http://tools.dynamicdrive.com/password/</a>
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/amystodd/.htpasswd
AuthGroupFile /dev/null
<Files myfile.zip>
require valid-user
</Files>Can someone please help me by giving me the code that will omit “myfile.zip” from being included in the rewrite rule? Thanks for reading.
Moved to CodeShare Corner by Moderator