John
John

Reputation: 10146

Can you have a sub directory ignore an htaccess file?

I have my website setup to point to a directory on the web server. I have a second site that is pointed to a sub folder inside the main directory of the main website. My question is, can you have the second site in the sub folder ignore any rules from the parent htaccess file in the main directory? I don't want the rules from the main site affecting anything for the second site that is in the sub folder of the root of the main site. I want to also point out the main site has multiple sites pointed to it, so I cant just write rules specific to just one domain.

Upvotes: 2

Views: 150

Answers (1)

anubhava
anubhava

Reputation: 785128

You will need to edit httpd.conf for this.

Create a <VirtualHost> entry for your subdomain if not already created. In the <VirtualHost> section of your 2nd site add this code:

DocumentRoot "/path/to/docuement/root/of/subdomain"

<Directory "/path/to/docuement/root/of/subdomain">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

Make sure to bounce apache after making these changes.

Upvotes: 1

Related Questions