【发布时间】:2010-05-04 18:29:02
【问题描述】:
您好,我有一个带有静态主页和名为文章的帖子页面的 Wordpress 安装。
我在 Wordpress 中的自定义永久链接字符串设置为 /%postname%
我的htaccess文件设置如下:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./index.php [L]
</IfModule>
当我浏览到文章页面时,我的 url 重写如下所示:
example.com/articles/page/5
编辑----- 文章页面是我用来浏览所有带有上一篇文章和下一篇文章链接的文章的页面。
因此下一篇文章将给我example.com/articles/page/6,上一篇文章将给我example.com/articles/page/4
但是我希望“页面”部分更改为文章,将“编号”更改为实际粒子名称。 编辑 ------ 结束
我想得到如下设置:
example.com/articles/article/the-article-name
我将如何做到这一点?
【问题讨论】:
-
假设你使用的是 Apache,mod_rewrite 是否开启?
-
@Chrostopher Altman - mod_rewrite 必须打开,因为帖子是 /articles/page/5 格式,否则它将是 example.com/?page_id=5