• I have some issues with WordPress .htaccess and password protected directories.

    First of all:

    The .htaccess from public_html:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    The .htaccess from commdemo (the directory that is pw protected):

    AuthType Basic
    AuthName “Restricted area”
    AuthUserFile “/home/web2i0/.htpasswds/public_html/commdemo/passwd”
    require valid-user

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    I have wordpress installed on public_html and on the pw protected directory: commdemo. The problems is that the .htaccess from public_html is stoping the pw protected directory commdemo as is should.

    Do you have any solutions for me? If I remove the content from .htaccess (public_html) commdemo is working as it should, but when I click on a link to a page it bombs with a 404 error.

    https://www.web2insight.com/commdemo
    https://www.web2insight.com/

    Please advice!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter rodesignweb

    (@rodesignweb)

    UP!

    Thread Starter rodesignweb

    (@rodesignweb)

    UP!

    I don’t know what you’re password protecting, but maybe this will help:
    WordPress admin password protection 404

    Thread Starter rodesignweb

    (@rodesignweb)

    Here is how I changed my .htaccess file

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/commdemo/(.*)$ [NC]
    RewriteRule ^.*$ – [L]
    </IfModule>

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    But the issue persists. One more time, if I remove all the content from the .htaccess file, the PW protected is working as it should, but my blog in no longer working.

    Exactly. Did you read the article at the link I posted?

    Many of us have had this problem, and I posted the ultimate solution (at least, in my opinion).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘.htaccess and PW protected directory’ is closed to new replies.