【问题标题】:mod_rewrite vs mod_rewrite.c, Is there a difference?mod_rewrite vs mod_rewrite.c,有区别吗?
【发布时间】:2015-08-12 15:49:12
【问题描述】:

这里是 wordpress .htaccess 文件:

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

# END WordPress

&lt;IfModule mod_rewrite.c&gt;&lt;/IfModule&gt; 是否检查mod_rewrite 模块是否已加载到服务器上?此外,如果&lt;IfModule mod_rewrite.c&gt;&lt;/IfModule&gt; 用于mod_rewrite,那么为什么&lt;IfModule mod_rewrite.c&gt;&lt;/IfModule&gt; 使用mod_rewrite 而不是mod_rewrite.c?是指here:

中提到的源文件吗?

【问题讨论】:

  • mod_rewrite.c 而不是 mod_rewrite.c ???
  • 抱歉是mod_rewrite

标签: wordpress apache .htaccess mod-rewrite


【解决方案1】:

您可以在这里阅读:http://httpd.apache.org/docs/2.4/en/mod/core.html#ifmodule

语法:

<IfModule [!]module-file|module-identifier> ... </IfModule>

对于 Apache 模块 mod_rewrite,它是 mod_rewrite.crewrite_module

【讨论】:

    【解决方案2】:

    http://httpd.apache.org/docs/current/mod/core.html#ifmodule

    &lt;IfModule test&gt;...&lt;/IfModule&gt; 部分用于标记指令 以特定模块的存在为条件。这 仅在测试时才处理部分中的指令 是真的。如果测试是假的,开始和结束之间的一切 标记被忽略。

    模块参数可以是模块标识符或文件 编译时模块的名称。例如, rewrite_module 是标识符,mod_rewrite.c 是文件名。

    http://httpd.apache.org/docs/2.2/mod/module-dict.html#SourceFile

    源文件

    这很简单地列出了源文件的名称,其中包含 模块的代码。这也是&lt;IfModule&gt; 使用的名称 指令。

    通俗地说,是的,IfModule 条件检查模块是否已加载。是的 mod_rewrite.c 是源文件。

    【讨论】:

      猜你喜欢
      • 2012-11-22
      • 2020-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-25
      • 1970-01-01
      • 1970-01-01
      • 2011-05-23
      相关资源
      最近更新 更多