【问题标题】:Wordpress mod_rewrite is stopping my query string from workingWordpress mod_rewrite 正在阻止我的查询字符串工作
【发布时间】:2018-02-13 22:07:24
【问题描述】:

在我的根目录.htaccess 文件中,wordpress 放了这个:

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

# END WordPress

在一个子目录中我有这个.htaccess 文件:

RewriteEngine on
RewriteRule ^bank/([^/.]+)/?$ bank/index.php?title=$1 [L]

我的.htaccess 文件可以在它位于根目录的其他服务器上运行!当bank/ 之后有任何内容时,我现在会收到 404 错误,但我知道bank/index.php 中的代码工作正常,bank/index.php?title=ppi 工作正常。

【问题讨论】:

标签: php wordpress mod-rewrite


【解决方案1】:

试试这个规则:

RewriteRule ^bank/([^/.]+)/?$ index.php?title=$1 [L]

或者将您的规则放入 Wordpress 规则之前文档根目录中的 .htaccess 文件中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-18
    • 1970-01-01
    • 1970-01-01
    • 2011-06-02
    • 2014-07-27
    • 1970-01-01
    • 1970-01-01
    • 2011-03-11
    相关资源
    最近更新 更多