• I have a separate folder on the server that requires htaccess authentication to password protect it, located at mydomain.com/app
    However, it requires an edit to the WP htaccess so that WP doesn’t throw a 404 error when going to mydomain.com/app
    So I have edited the htaccess to read

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

    Specifically RewriteRule ./ /index.php [L]

    Problem: if I go to, for example, mydomain.com/events –no trailing slash, I get an Apache 404 error.
    If I go to mydomain.com/category/news — no trailing slash, it redirects to the trailing slash and all is well. So the problem seems to be restricted to the main directory level.

    Worth mentioning is that the WP admin is contained within the subdirectory mydomain.com/wp and all is well there also.

    In addition, periodically out of the blue, WP seems to rewrite my htaccess, and we’re back where we started, namely mydomain.com/app throws a WP 404 error.

    Rather frustrating overall.

    Is there a fix for this, or should I be looking at an alternative, such as putting the app (that requires password authentication and is not WP) into a subdomain instead, such as app.mydomain.com ?

    Advice and insights welcome. Thanks.
    I have

The topic ‘404 errors with no trailing slash/htaccess rules’ is closed to new replies.