• Hello,
    I am an experienced web developer (ASP & PHP) but new to WordPress. I have installed and deployed our site using WordPress and everything works well, EXCEPT the non WP PHP pages located in a subfolder off the web root. These pages are not part of the public site, and are not intended for public viewing. WordPress is installed in a folder named {WordPress}, which is also directly off the root.

    The problem I am having is now that WP is up and running, navigating to my PHP pages in the {XYZ} folder returns a 404 not found error. If I disable the .htaccess file, I can go to mydomain.org/xyz/index.php with no problem, BUT all WP pages except the home page error 404. I would like to modify the .htaccess file to allow permission to go to {xyz} folder and all pages within, but don’t know enough about the coding of .htaccess.

    I have tried several suggestions found here and via Google search, but none have worked so far. Here is my existing .htaccess:

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

    I have tried uncommenting both the early block of code and the single line in the WP portion, individually, without success. Any assistance you could offer would be greatly appreciated.

    FOLDER STRUCTURE
    Root
    >other folders
    >XYZ folder
    > >my php files
    >WordPress
    > >wp-admin
    > >wp-content
    > >wp-includes

    .htaccess file located in ROOT folder contains code above.
    .htaccess file in WordPress folder is empty
    .htaccess file in XYZ folder contains only folder permission code (see below)

    Options -Indexes
    AuthType Basic
    AuthName "XYZ-Database"
    AuthUserFile "/home/MyWeb/.htpasswds/public_html/XYZ folder/passwd"
    require valid-use

    A link to the page where the problem occurs can be supplied if necessary, but has not been included here for security purposes.

    Thank you.

  • The topic ‘Enable web access to a Non-WP subdirectory’ is closed to new replies.