【问题标题】:WordPress .htaccess File & Password Protected Web App FolderWordPress .htaccess 文件和密码保护的 Web 应用程序文件夹
【发布时间】:2014-05-06 19:46:23
【问题描述】:

我的服务器上安装了一个 WordPress 网站并且可以正常运行。

我创建了一个名为“billing”的新文件夹并将我的计费网络应用程序放入其中。当我访问 www.example.com/billing/index.php 时,一切正常且符合预期。但是,一旦我在 cPanel 中用密码保护该文件夹并转到 www.example.com/billing/index.php,它就会将我引导回我的 WordPress 网站,然后我会收到找不到页面的错误。

我认为这与我的 .htaccess 有关。我确实删除了下面的所有代码,并且能够在受密码保护的情况下访问 www.example.com/billing/index.php,但随后我网站上的其他网页停止工作,例如 www.example.com/about/ What am我错过了这里?

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

【问题讨论】:

    标签: wordpress .htaccess


    【解决方案1】:

    在其他条件之前添加一个条件,以排除 billing/ 目录中的任何内容被重写为 index.php

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_URI} !^/billing/.*$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

    【讨论】:

      猜你喜欢
      • 2014-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-29
      • 2012-10-03
      • 2012-11-14
      相关资源
      最近更新 更多