root htaccess file preventing access to subdomain – 403 Forbidden error

Home Forums BulletProof Security Free root htaccess file preventing access to subdomain – 403 Forbidden error

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17791
    Nawaz Khan
    Participant

    Hi,

    I am a registered BPS Pro user but this issue relates to BPS Free. My root .htaccess is preventing access to sub domain with 403 Forbidden.

    I have trawled many of the posts relating to this issue – but cannot figure out what rules I need in my sub domain’s .htaccess to allow the sub domain to function correctly.

    WordPress is installed in root and sub domain. DNS set up correctly. And static HTML file in sub domain to eliminate any WordPress specific redirection issue. Can you advise?

    Many thanks.
    Nawaz

    #17793
    AITpro Admin
    Keymaster

    What is the folder structure for all sites? What types of WordPress installations are each site? Single/Standard, Network/Multisite, Giving WordPress its Own Directory (GWIOD)? Is your subdomain site setup correctly? A subdomain site requires that you create a DNS A record or CNAME record and point the record to the folder where you installed the subdomain site. If the site is actually a subdirectory installation and not a subdomain site then you do not need to make DNS Changes. What is the URL structure? Please explain exactly what this means and what is in the file – “And static HTML file in sub domain to eliminate any WordPress specific redirection issue”.

    Examples:
    /public_html/ – site is installed in the root folder
    /public_html/SiteA/ – SiteA is installed in the SiteA folder – SiteA could be either a subdirectory site or a subdomain site.

    URL Examples:
    example.com
    subdomain.example.com
    example.com/subdirectory

    #17796
    Nawaz Khan
    Participant

    Single WP installs
    Main site resides in root /public_html/ [www.domain.com]
    test clone of main site in /public_html/test/ [test.domain.com]
    I did indicate sub domain is working. DNS is fine. If I remove root .htaccess then everything works as expected
    I have a static HTML file in the sub domain for testing the sub domain – so as to not involve wordpress – which bit don’t you understand?
    I explicitly said – my root .htaccess file is the problem. I would not make such a sweeping statement if I had not tested the sub-domain without root .htaccess file.
    with .htaccess – sub domain no worky
    without .htaccess – sub domain worky

    Nz

    #17798
    AITpro Admin
    Keymaster

    I think I have enough information to make a logical guess at what is occurring now.  The root .htaccess file is applying its Rewrites and rules to the child folders, which is the natural hierarchical/recursive nature of htaccess files.  If a parent folder has an htaccess file and a child folder has an htaccess file then the parent will follow its rules and not apply its rules to the child folder because the child folder will follow the rules in its htaccess file instead of the parent htaccess file (for the most part – see the link below for more info).

    This Forum topic explains the hierarchical/recursive nature of htaccess files: http://forum.ait-pro.com/forums/topic/htaccess-files-for-multiple-website-domains/

    It is also possible to tell the parent htaccess file NOT to apply its rules to a child folder/website.  You would use this method:  http://forum.ait-pro.com/forums/topic/custom-applications-outside-of-wordpress-3rd-party-apps/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.