简体   繁体   English

WP中的自定义永久链接

[英]Custom permalink in WP

How to archive the URL rewrite from example.com/?special=25 to example.com/special/25 .如何归档 URL 重写从example.com/?special=25example.com/special/25

Check out the WordPress WP Rewrite class .查看 WordPress WP 重写 class The examples towards the bottom look like they'd get what you are trying to achieve.底部的示例看起来像是您想要实现的目标。 Sadly not used this before so can't provide an example.遗憾的是之前没有使用过这个,所以不能提供一个例子。

Without any more context to the question, it's a little difficult to say;如果没有更多关于这个问题的背景,这有点难以说; however, based on the URL scheme that you've provided, 'special' appears to be a category, custom post type, or some other taxonomy .但是,根据您提供的 URL 方案,“特殊”似乎是一个类别、自定义帖子类型或其他一些分类法

If that's the case, then you can use a custom permalink setting set to: /%postname%/ and that would take care of it.如果是这种情况,那么您可以使用设置为: /%postname%/的自定义 永久链接设置,这样就可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM