Forum Moderators: phranque

Message Too Old, No Replies

"Option -Indexes" works but disables CGI?

How to set it up in HTACCESS?

         

craig1972

12:46 am on Jun 7, 2005 (gmt 0)

10+ Year Member



I would like to disable the directory listings on my site. So I included this in my .htaccess file in the public_html folder:

Options -Indexes Followsymlinks

This works, the directory now doesn't get listed (shows 403) but now the files in /public_html/cgi-bin will not execute! I added "ExecCGI" to the above line, but still the same, it keeps showing 403 even when I specify the exact CGI in the path.

So, my htaccess currently is:

Options -Indexes Followsymlinks ExecCGI


And the path I am trying to access is:

http://MYDOMAIN.com/cgi-bin/x.cgi

If I remove that Options line from my htaccess, this cgi file works. I have tried CHMODing the cgi-bin and the file differently, I then created a new htaccess inside the cgi-bin and allowed Options Indexes in there, but no go, still 403.

What am I to do?

jdMorgan

4:16 am on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Read very carefully the syntax of Options [httpd.apache.org].

You will discover that you have disabled all options except for FollowSymLinks in your first example by omitting the "+" or "-" signs on several arguments... :)

Options without "+" or "-" replace all other options settings, rather than adding or subtracting one or more settings from the current set.

Jim

craig1972

4:51 am on Jun 7, 2005 (gmt 0)

10+ Year Member



Thanks. I read through the manual, but it does a lousy job of explaining anything. Now I have this:

Options +FollowSymLinks -Indexes +ExecCGI

But nothing's changed. CGI files are still giving 403.

jdMorgan

4:57 am on Jun 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does your server error log say?
Are your file permissions set properly to allow world read and execute of the script and script directory?

Jim

craig1972

5:10 am on Jun 7, 2005 (gmt 0)

10+ Year Member



Well the CGI file is CHMODed to 755. Is this not enough to execute?

jdMorgan

1:08 am on Jun 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does your server error log say?