WordPress mod_rewrite 在插件中?

发布于 2024-10-03 11:23:37 字数 463 浏览 1 评论 0原文

我尝试了几次 mod_rewrite 但我请求你的帮助,因为这是一个复杂的问题。

Wordpress 有自己的永久链接结构,它使用 mod 重写来使 url 的搜索引擎友好。

我有 2 个插件。 1. 将页面变成子目录。所以domain.com/page/变成了page.domain.com 2. 第二个是一个论坛,创建诸如 /?mingleforumaction=viewforum&f=2.0 和 ?mingleforumaction=viewtopic&t=23.0 等页面,

如何将当前

http://page.domain.com/?mingleforumaction=viewtopic&t=23.0

转到

http://page.domain.com/title-of-the-forum-topic/

I tried several mod_rewrite but I asking your help, because this is a complicated matter.

Wordpress has its own permalink structure that uses mod rewrite to make the url’s search engine friendly.

I have 2 plugins.
1. Turns a page into a subdirectory. So domain.com/page/ turns into page.domain.com
2. The second one is a forum that creates pages such as /?mingleforumaction=viewforum&f=2.0 and ?mingleforumaction=viewtopic&t=23.0

How can I turn the current

http://page.domain.com/?mingleforumaction=viewtopic&t=23.0

to

http://page.domain.com/title-of-the-forum-topic/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

谁人与我共长歌 2024-10-10 11:23:37

为什么不问插件作者呢?您确定您的插件可以处理这种结构吗?如果是,那么为什么它们没有附带 mod_rewrite 规则?

Why not to ask plugin author? Are you sure your plugins will handle such structure? If yes, then why there is no mod_rewrite rules shipped with them?

奢望 2024-10-10 11:23:37

你不能仅仅根据主题标题来做到这一点,这些标题并不是唯一的。但是,你可以这样做
http://page.domain.com/23.0/title-of-the-forum-topic/
其中 23.0 显然是 t 在查询字符串中设置的值。

编辑

RewriteEngine on
RewriteRule ^/topic/([0-9\.]+)/ /?mingleforumaction=viewtopic&t=$1

You can't do it based solely on the topic title, those aren't unique. You could, however, do
http://page.domain.com/23.0/title-of-the-forum-topic/
where 23.0 is obviously the value that t would be set to in the query string.

Edit

RewriteEngine on
RewriteRule ^/topic/([0-9\.]+)/ /?mingleforumaction=viewtopic&t=$1
从﹋此江山别 2024-10-10 11:23:37

由于 IP 不同,openid 不允许我从家里登录,但我与主题发起者是同一个人:

@spartan018
那怎么办呢?

@FractalizeR
开发人员 http://cartpauj.com/projects/mingle-forum-plugin/使用了较旧的论坛插件,并且没有知识(或者可能没有时间学习)来重写插件,使其具有与 WordPress 的永久链接结构一起使用的 mode_rewrite 规则。所以我希望帮助他,但自己却陷入困境,因为正常的 .htaccess mod_rewrite 似乎不起作用,而且它基于已经存在的 wordpress mod_rewrite。这就是我寻求帮助的原因:)

openid does not let me login from home because of a different IP, but I am the same person as the topic starter:

@spartan018
How can that be done?

@FractalizeR
The developer http://cartpauj.com/projects/mingle-forum-plugin/ used an older forum plugin and does not have the knowledge (or perhaps time to learn) to rewrite the plugin for it to have mode_rewrite rules shipped with in of have the plugin work with the permalink structure of wordpress. So I was hoping to help him, but got stuck myself because normal .htaccess mod_rewrite do not seem to work and it is based on an already existing wordpress mod_rewrite. That is why I asked for help :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文