Wordpress permalinks & Directory Listing

Discussion in 'Apache' started by davewiththenicehat, Apr 10, 2020.

  1. #1
    What could I do to allow password protected directory listing with wordpress permalinks enabled? I do not have access to apache.conf. It's a godaddy server.

    I have a wordpress site that I need to have directory listing enabled on a folder that also requires password authentication.

    The .htaccess for this site is:
    # BEGIN WordPress
    # The directives (lines) between `BEGIN WordPress` and `END WordPress` are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    ErrorDocument 404 /index.php?error=404
    
    # BEGIN WordPress
    # The directives (lines) between `BEGIN WordPress` and `END WordPress` are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    
    # END WordPress
    
    Code (ApacheConf):
    The .htaccess file I have in the folder that I need directory listing on is:
    Options +Indexes
    AuthType Basic
    AuthName "scanners"
    require valid-user
    AuthUserFile "/path/to/password/file"
    
    Code (ApacheConf):
    My expected behavior is to be prompted for the user ID and password for the folder's authentication then view the directory listing when the correct password is entered.
    The behavior I see is, the could not find this page wordpress page. In other words the fancy 404 page you get with wordpress.

    If I change the .htaccess file in the folder I need directory listing working to omit the authentication requirements. I can see the directory without issue. An example of this .htacces file would be:
    Options +Indexes
    Code (ApacheConf):


    Thanks for your time.
     
    davewiththenicehat, Apr 10, 2020 IP
  2. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #2
    JEET, Apr 10, 2020 IP
  3. davewiththenicehat

    davewiththenicehat Greenhorn

    Messages:
    2
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Thanks for the reply.
    That is the method I have in use. While I explained that in the post I failed to provide full example paths to the files to make it obvious. Unfortunately I can not figure out how to edit that post to update it.
    Sorry it was not clear. Mistake on my part.
     
    davewiththenicehat, Apr 13, 2020 IP
    JEET likes this.