[solved] I want to return 403 error when auto index is disabled

#1
Hello.
I have installed LiteSpeed and set it up.
There is one thing I don't understand.
I want to return a 403 Forbidden error on a site that has auto index disabled, how should I set it?
Currently 404 error is returned.
I would appreciate any advice.
LiteSpeed is LiteSpeed Enterprise 5.4.1.
Best regards.
 

NiteWave

Administrator
#2
you may need be more specific about your test case.

I tested on a test20/ directory.
test URL is domain.com/test20/
Code:
cat test20/.htaccess
Options -Indexes
when access the test URL, both apache and lsws return
403 Forbidden

and in browser window, shows
[an error occurred while processing this directive]
 
#3
Hello.
Certainly, when auto indexing is disabled in .htaccess, 403 error appears instead of 404 error.
However, when “Auto Index” is set to “no” in “Server” → “Index Files” of LiteSpeed, 404 error is displayed instead of 403 error.
Is there any solution?
Best regards.
 
#5
Hello.
thank you for the advice.
By writing
Code:
options -Indexes
in "Apache Style configurations" of "Server" in the LiteSpeed WebAdmin Console, the expected behavior is achieved.
Thank you very much.
Best regards.
 
#6
Is this still working for you, people? Litespeed is returning 404 for me even with all the settings mentioned above are set correctly.

cPanel 102 + LiteSpeed Web Server Enterprise 6.0.11

What I've done so far:

- unticked Indexes in Apache global configuration @cPanel
- set Auto Index to No under Server -> General -> Index Files @litespeed web console
- set "Options -Indexes" in Server-> General -> Apache Style Configurations @litespeed web console
 
Top