.htaccess allow from my web server

Hi all,

I’m trying to write a simple .htaccess script to prevent users from viewing contents of a certain directory on my site.

Basically, I need to make this directory accessible by script only.

I know this much:

order deny,allow
deny from all
allow from

However, I don’t know the IP address of my server. Or, should I use a domain?

Really appreciate any help.

Couldn’t you just use the loopback address,

No, because the web server isn’t running on (For load distribution reasons, there is actually more than one Apache service running on each shared hosting machine.)

There isn’t really any general answer I can give you, as each web server has more than one IP address, and it’s not always predictable which one it will use, especially to connect to itself like you’re doing. If at all possible, I’d look into what it’d take to run your scripts without getting the web server involved.

If you want to run it only from a script, then why not move it out of webspace and into /home/USER/SCRIPTS?