How to stop sub directory inheriting parent's htaccess rules

后端 未结 2 1806
我在风中等你
我在风中等你 2020-12-15 04:22

My main public_html directory has the following .htaccess rules:

Options +FollowSymLinks
IndexIgnore */*

RewriteEngine on

# i         


        
2条回答
  •  北海茫月
    2020-12-15 04:51

    Change your .htaccess with this:

    Options +FollowSymLinks
    
    RewriteEngine on
    RewriteBase /
    
    # if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # if request is not for the /sub-dir/
    RewriteCond %{REQUEST_URI} !^/sub-dir/ [NC]
    # otherwise forward it to index.php
    RewriteRule . index.php
    
    

提交回复
热议问题