0

I want to give

Forbidden
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.

0

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 '16 at 14:10
  • @A.B. added sudo, Too many CentOS days of being root for this stuff. – 0x7c0 Jan 14 '16 at 14:16
  • =) yes, it's confusing – A.B. Jan 14 '16 at 14:26

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.