[wp-hackers] Unique permalinks vs. unique post slugs
Shashi
connect2shashi at gmail.com
Wed Dec 17 11:39:09 GMT 2008
I have seen that it comes back yo the same post no matter what
category you give..
On Tue, Dec 16, 2008 at 9:44 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.
>
> 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.
>
> Changing this would not be trivial.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
--
, ,
/ \
((__-^^-,-^^-__))
`_----' `-----_-'
`--| o` 'o |--'
\ ` /
): : (
:o__o:
"---- "
www.gnu.org
www.uncorkers.org
More information about the wp-hackers
mailing list