Edward Williams
Edward Williams

Reputation: 307

HTACCESS - restrict access to several domains / scripts

ok so, I have a central media directory. This is the private members files, I don't want this accessible directly.

There are 3 or 4 domains that access this member files directory.

How would I go about locking the directory down so only php scripts can access it from the web, and only from those 3 or 4 domains?

There's posts on locking down to a domain, and posts for locking down to php, but I can't find anything that locks down to php on a set of different domains.

Your help with this is appreciated, thanks for reading. :)

Upvotes: 0

Views: 1066

Answers (2)

pinaldesai
pinaldesai

Reputation: 1815

Try something like

<Limit GET>
order deny,allow
deny from all
allow from .domain1.com
allow from .domain2.com
</Limit>

Checkout more information Here http://forums.cpanel.net/f5/htaccess-block-domains-not-working-64831.html

Upvotes: 1

Quentin
Quentin

Reputation: 943996

This is the private members files, I don't want this accessible directly.

Don't put it under the web root directory.

How would I go about locking the directory down so only php scripts can access it from the web, and only from those 3 or 4 domains?

There is no way to tell if a client was written using PHP or not.

Thanks to Virtual Hosting, there is no way to tell what domain was the origin of a request (as requests come from ip addresses and an ip address can have multiple host names).

Use password or public key authentication instead.

Upvotes: 1

Related Questions