【问题标题】:.htaccess remove RewriteBase.htaccess 移除 RewriteBase
【发布时间】:2013-05-17 19:54:14
【问题描述】:

以下 .htaccess 代码在我的 /business/ 网站上使用,因为它是一个演示网站,所以我必须多次复制它,使用不同的文件夹名称...比如 /business/ /restaurants/ /law/

是否可以删除RewriteBase /business/RewriteRule . /business/index.php [L]

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

【问题讨论】:

    标签: .htaccess mod-rewrite


    【解决方案1】:

    从技术上讲,您应该能够做到这一点,删除规则目标中的 RewriteBase 和绝对 URI 路径:

    RewriteEngine On
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]
    

    但取决于index.php 以及它如何提取 URI 信息,它可能不喜欢它。你应该可以把它放在任何文件夹中。

    【讨论】:

      猜你喜欢
      • 2013-08-27
      • 2020-06-21
      • 1970-01-01
      • 2015-11-16
      • 1970-01-01
      • 2012-03-14
      • 1970-01-01
      • 1970-01-01
      • 2023-03-16
      相关资源
      最近更新 更多