【问题标题】:URL rewriting in WordpressWordpress 中的 URL 重写
【发布时间】:2010-06-04 03:00:08
【问题描述】:

我想在 wordpress 中重写我的网址。 如何在 wordpress 中重写我的网址。 我正在尝试创建如下所示的 htaccess 文件

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /shopboxtile/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)$ http://localhost/shopboxtile/?productid=$1
</IfModule>

我认为它不正确。请帮助我更正它。 我的要求是从 http://localhost/shopboxtile/?productid=59961http://localhost/shopboxtile/59961

【问题讨论】:

  • 为什么 url from 和 to 是同一个 url?

标签: wordpress url-rewriting


【解决方案1】:

尝试将其放入.htaccess 文件夹中的shopboxtile 文件中

RewriteEngine On

RewriteRule ^([0-9]+)$ ?productid=$1 [QSA]

【讨论】:

  • 感谢您的回复马克。我还有一个问题可以请您帮帮我。我正在使用 remove_filter('template_redirect', 'redirect_canonical'); 禁用 wordpress 重写。此功能正在工作,但在我的应用程序在我的根目录中不涉及我的 .htaccess 文件。我们如何解决这个问题。请少花点宝贵的时间给我主人..请
  • Imm,我对 wordpress 的 remove_filter 缺乏了解,可能会对此提出新的问题remove_filter
猜你喜欢
  • 2012-10-25
  • 2012-10-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-03-04
  • 2019-05-13
  • 1970-01-01
相关资源
最近更新 更多