I want to give

You don't have permission to access /draft/ on this server.

so added .htaccess to folder with

Options -Indexes

But it's not working on ubuntu server and displaying folder files. Its working on my local system (windows) though.

1 Answer 1


Please check that the websever has read access to the location. So for a path of /var/www/drafts and to give the web server read + write access

sudo chown -R www-data /var/www/drafts
sudo find /var/www/drafts -type f  -exec chmod 640 {} \;
sudo find /var/www/drafts -type d  -exec chmod 750 {} \;

It's unclear from your question if you want it to list files or not but:

If you want to show a listing of files for /drafts

You need to do

Options +Indexes

-Indexes removes the option

  • chown without sudo?
    – A.B.
    Jan 14, 2016 at 14:10
  • @A.B. added sudo, Too many CentOS days of being root for this stuff.
    – squareborg
    Jan 14, 2016 at 14:16
  • =) yes, it's confusing
    – A.B.
    Jan 14, 2016 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .