【问题标题】:Remove all htaccess rule from subdirectory从子目录中删除所有 htaccess 规则
【发布时间】:2015-10-12 10:01:14
【问题描述】:

我在我的文档根目录中使用这个 .htaccess 文件。

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>

我无法更改主域的根目录(它是 /public_html/),当我创建一个新的子域时,它的默认文件夹将是 /public_html/subdomain,因此所有 .htaccess 规则都将应用于它。我不希望我的子域文件夹受到根目录中的 .htaccess 的影响。有什么办法可以做到这一点?

感谢您的帮助!

【问题讨论】:

    标签: apache .htaccess mod-rewrite shared-hosting


    【解决方案1】:

    我通过在目录中创建一个 .htaccess 文件解决了这个问题,规则如下:

    <IfModule mod_rewrite.c>
    RewriteEngine off
    </IfModule>
    

    谢谢!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-25
      • 1970-01-01
      • 2014-12-17
      • 1970-01-01
      • 2015-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多