Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with .htaccess please

Status
Not open for further replies.

TSRman

Technical User
Oct 21, 2005
6
GB
I run a site wich is externally hosted, so I have no control over Apache per se. I am trying to use .htaccess with some limited success but would appreciate some help.

My host appears to have '+Indexes' as the default as any folder can be browsed. I want to stop this, and provide 'home grown' error pages.

I put

Options -Indexes
ErrorDocument 401 /error_docs/unauthorised.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html

In the root - and that worked, stopping browsing in all folders

I then wanted to enable browsing in 1 particular folder
so I put

Options +Indexes

in that folder - it didnt work. why?

I changed the root .htaccess - took out '-Indexes'
to use the default which is 'enabled browsing'
and then put '-Indexes' in every other folder except the one I want to browse - that worked - but seems to me to be the wrong way to go about it
i.e. stop all and permit specific is more secure.

Comments / help Please?

Also with the '-Indexes' in the /cgi-bin/ folder .pl scripts dont execute and email form falls over - so I took it out and at the moment that folder can be browsed

Again - help please

Allan
 
OK - tried that
All .htaccess removed
Added root .htaccess with 'Options -Indexes' plus error pages bit
This stops all browsing ( and email form no longer works - cant access .pl in /cgi-bin/ folder )
Added
AllowOverride All
Options +Indexes in the appropriate folder
but browsing still not permitted in the folder

 
Sorry, a little testing on my part seems to indicate that AllowOverride doesn't seem to be required after all.

Try this in the subfolder that you want to browse:

IndexOptions FancyIndexing
Options Indexes
 
Thanks - I cut and paste your 2 lines
but still no go

I tried 'Options Indexes' and 'Options +Indexes'
no difference

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top