Htaccess


#1

Is there a way I can make a folder password protected like I can with the GUI DreamHost has, but only for everybody except for one domain which isn’t my own domain?

So I for example can store some images on my domain, and have them being visible when I link to them in a forum on the other domain, but password protected if you’re not from the that particular other domain.

I tested the GUI, and it just gives access to all, blocks all, or requires password when it’s from the other domain.

I hope you understand my clumpsy explanation :wink:


O_o | o_O | I’m never mistaken. Except for that one time when I thought I was mistaken.


#2

I wanted to do something similar, allow linking from LiveJournal, but have personal photos password protected. I set up link protection with exceptions, then set up an FTP user for the personal photos.

As you say, looks like link protection and password protection is an either/or situation from the control panel.

Kathy


#3

While DH may not have provide an option for that in the web control panel, you might able to do this yourself.

DH is currently running Apache 1.3.x and the documentation is found here:
http://httpd.apache.org/docs/

I haven’t tried to do this - but an idea that comes to mind is:

  1. Use the ‘hotlink prevention’ option to setup ‘example.com/images/public

  2. Modify the resulting .htaccess so if the referer does not match the fourm URI the visitor is redirected to ‘example.com/images/private’ (currently the hotlink protection code just tells the visitor access is forbidden)

  3. Set up ‘example.com/images/private’ so that it is not only password protected, but uses the Rewrite Engine to also map requests for images in this directory to image files in the ‘example.com/images/public’ directory instead, avoiding keeping duplicate files or having to symlink to the originals.

:cool: Perl / MySQL / HTML+CSS