[wp-hackers] Unique permalinks vs. unique post slugs

scribu scribu at gmail.com
Tue Dec 16 16:49:04 GMT 2008


On Tue, Dec 16, 2008 at 6:14 PM, Otto <otto at ottodestruct.com> wrote:
> On Tue, Dec 16, 2008 at 9:06 AM, Shashi <connect2shashi at gmail.com> wrote:
>> You can add the post to two categories...
>> the struct will then be:
>>
>> http://example.com/cat-base/cat-slug/post-slug.html
>> http://example.com/cat-base/cat-slug2/post-slug.html
>>
>> right??
>>
>> you can hack the rewrite to allow you to have it like this:
>> http://example.com/cat-slug/post-slug.html
>
> You'd have to hack a lot more than the rewrite. The query only
> operates on the most specific piece found, I think.

I was afraid of that.

> So if you give it both a category and a post slug, it then knows a)
> you're pulling a single post (so it uses the single post template) and
> b) the post to pull has post-slug X. The category is not used, at all.


> This is why if you have a permalink string of %category%/%postname%,
> then you can give it ANY category in the URL and still get the same
> post back. The category is less specific than the postname, so it's
> assuming you want the single post.

I have noticed this before and filed it as a
bug<http://trac.wordpress.org/ticket/7187>.
I don't think it's okay to have an infinite number of possible URL
combinations all returning the same content. It should at least redirect to
a single URL with the appropriate category slug.

--
http://scribu.net


More information about the wp-hackers mailing list