JasonDavis
JasonDavis

Reputation: 48963

How to only show server directory list to a certain user in PHP?

I just finally after trying many time over the past few years, got my dev serer online. I put it online so I can show a couple friends progress on my work so I am not that worried about security because only a couple people will know the URL.

One thing I would like to accomplish though it to have the default directory list hidden, I know that is easy in an .htaccess file but I would like to somehow still show the directory lists to me, it could use some sort of login or based on my home IP, I just need a simple way, any suggestions on how I can do this?

I know I can make a simple PHP script but I would need to drop it into every directory almost and I would like to avoid that if possible.

Upvotes: 0

Views: 113

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799082

Make a separate <VirtualHost> that contains:

Deny from all
Allow from <your IP address here>
Options +Indexes

Upvotes: 1

Related Questions