Mailing List Archive

Is it possible to exclude a directory from listing?
Hello,
Is it possible to disable Directory Listing for a directory and its sub-directory except one of them?
For example, I used "Options -Indexes" and my directory have two sub-directories "Dir1" and "Dir2", but I like Directory Listing enabled for "Dir2".

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Is it possible to exclude a directory from listing? [ In reply to ]
Options None



Sent from my iPhone

> On Jan 21, 2021, at 6:49 AM, Jason Long <hack3rcon@yahoo.com.invalid> wrote:
>
> ?Hello,
> Is it possible to disable Directory Listing for a directory and its sub-directory except one of them?
> For example, I used "Options -Indexes" and my directory have two sub-directories "Dir1" and "Dir2", but I like Directory Listing enabled for "Dir2".
>
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Is it possible to exclude a directory from listing? [ In reply to ]
> Is it possible to disable Directory Listing for a directory and its sub-directory except one of
> them?

Sure. You can do something like this. Pls set your correct paths.

# Disable directory listing for myparentdir and all of its subdirs
<Directory /var/www/html/myparentdir>
Options -Indexes
Require all granted
</Directory>

# Just enable directory listing for this subdir
<Directory /var/www/html/myparentdir/Dir2>
Options +Indexes
</Directory>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Is it possible to exclude a directory from listing? [ In reply to ]
Thank you.
I did:
<Directory "/var/www/wp">
Options -Indexes
AllowOverride All
Require all granted
</Directory>

But when I browse "https://MyDomain.net/wp-content/plugins" then I can see the content of the plugins directory!
Why?






On Thursday, January 21, 2021, 07:56:38 PM GMT+3:30, Dino Ciuffetti <dino@tuxweb.it> wrote:





> Is it possible to disable Directory Listing for a directory and its sub-directory except one of
> them?

Sure. You can do something like this. Pls set your correct paths.

# Disable directory listing for myparentdir and all of its subdirs
<Directory /var/www/html/myparentdir>
  Options -Indexes
  Require all granted
</Directory>

# Just enable directory listing for this subdir
<Directory /var/www/html/myparentdir/Dir2>

  Options +Indexes
</Directory>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Is it possible to exclude a directory from listing? [ In reply to ]
On Thursday 21 January 2021 at 22:09:39, Jason Long wrote:

> I did:
> <Directory "/var/www/wp">
> Options -Indexes
> AllowOverride All
> Require all granted
> </Directory>
>
> But when I browse "https://MyDomain.net/wp-content/plugins" then I can see
> the content of the plugins directory! Why?

Perhaps because "wp-content" is not the same as "wp"?

You've told us what your settings are for "/var/www/wp".

We have no idea how this relates to "https://MyDomain.net/wp-content/plugins"

Show us more of your configuration and someone might be able to help.

Oh, and by the way, why do you want "AllowOverride All"?


Antony.

--
Never write it in Perl if you can do it in Awk.
Never do it in Awk if sed can handle it.
Never use sed when tr can do the job.
Never invoke tr when cat is sufficient.
Avoid using cat whenever possible.

Please reply to the list;
please *don't* CC me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Is it possible to exclude a directory from listing? [ In reply to ]
On 21/01/2021 11:49, Jason Long wrote:
> Hello,
> Is it possible to disable Directory Listing for a directory and its sub-directory except one of them?
> For example, I used "Options -Indexes" and my directory have two sub-directories "Dir1" and "Dir2", but I like Directory Listing enabled for "Dir2".
>
> Thank you.

Another way is to create a simple index.php file with a link to the main
site or some info about going to the home page.


--
With over 1.2 billion devices now running Windows 10, customer
satisfaction is higher than any previous version of windows.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Is it possible to exclude a directory from listing? [ In reply to ]
Thank you for your reply.
The "wp-content" directory is a sub-directory of "wp" directory:
$ ls /var/www/wp/
cgi-bin                                              wp-content
error_log                                          wp-cron.php
googlee4e6cdb3b56c49dd.html      wp-includes
index.php                                         wp-links-opml.php
license.txt                                         wp-load.php
readme.html                                     wp-login.php
ssl                                                     wp-mail.php
wordfence-waf.php                           wp-settings.php
wp-activate.php                                wp-signup.php
wp-admin                                          wp-statistics.log
wp-blog-header.php                          wp-trackback.php
wp-comments-post.php                     xmlrpc.php
wp-config.php                                    zhupclient_key.1567309333.html
wp-config-sample.php                       zhupclient_key.1567317901.html


How about "AllowOverride All"? 
If I want to disable the Directory Listing for all directories then what should my settings be like?
If I want to disable the Directory Listing for all directories except "wp-includes" directory then what should my settings be like?

Thank you.





On Friday, January 22, 2021, 01:11:41 AM GMT+3:30, Antony Stone <antony.stone@apache.open.source.it> wrote:





On Thursday 21 January 2021 at 22:09:39, Jason Long wrote:

> I did:
> <Directory "/var/www/wp">
> Options -Indexes
> AllowOverride All
> Require all granted
> </Directory>
>
> But when I browse "https://MyDomain.net/wp-content/plugins" then I can see
> the content of the plugins directory! Why?

Perhaps because "wp-content" is not the same as "wp"?

You've told us what your settings are for "/var/www/wp".

We have no idea how this relates to "https://MyDomain.net/wp-content/plugins"

Show us more of your configuration and someone might be able to help.

Oh, and by the way, why do you want "AllowOverride All"?


Antony.

--
Never write it in Perl if you can do it in Awk.
Never do it in Awk if sed can handle it.
Never use sed when tr can do the job.
Never invoke tr when cat is sufficient.
Avoid using cat whenever possible.

                                                  Please reply to the list;
                                                        please *don't* CC me.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Is it possible to exclude a directory from listing? [ In reply to ]
Hello,
Any idea?






On Friday, January 29, 2021, 04:07:30 PM GMT+3:30, Jason Long <hack3rcon@yahoo.com.invalid> wrote:





Thank you for your reply.
The "wp-content" directory is a sub-directory of "wp" directory:
$ ls /var/www/wp/
cgi-bin                                              wp-content
error_log                                          wp-cron.php
googlee4e6cdb3b56c49dd.html      wp-includes
index.php                                         wp-links-opml.php
license.txt                                         wp-load.php
readme.html                                     wp-login.php
ssl                                                     wp-mail.php
wordfence-waf.php                           wp-settings.php
wp-activate.php                                wp-signup.php
wp-admin                                          wp-statistics.log
wp-blog-header.php                          wp-trackback.php
wp-comments-post.php                     xmlrpc.php
wp-config.php                                    zhupclient_key.1567309333.html
wp-config-sample.php                       zhupclient_key.1567317901.html


How about "AllowOverride All"? 
If I want to disable the Directory Listing for all directories then what should my settings be like?
If I want to disable the Directory Listing for all directories except "wp-includes" directory then what should my settings be like?

Thank you.





On Friday, January 22, 2021, 01:11:41 AM GMT+3:30, Antony Stone <antony.stone@apache.open.source.it> wrote:





On Thursday 21 January 2021 at 22:09:39, Jason Long wrote:

> I did:
> <Directory "/var/www/wp">
> Options -Indexes
> AllowOverride All
> Require all granted
> </Directory>
>
> But when I browse "https://MyDomain.net/wp-content/plugins" then I can see
> the content of the plugins directory! Why?

Perhaps because "wp-content" is not the same as "wp"?

You've told us what your settings are for "/var/www/wp".

We have no idea how this relates to "https://MyDomain.net/wp-content/plugins"

Show us more of your configuration and someone might be able to help.

Oh, and by the way, why do you want "AllowOverride All"?


Antony.

--
Never write it in Perl if you can do it in Awk.
Never do it in Awk if sed can handle it.
Never use sed when tr can do the job.
Never invoke tr when cat is sufficient.
Avoid using cat whenever possible.

                                                  Please reply to the list;
                                                        please *don't* CC me.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org