[wp-hackers] can url auto-completing in wordpress by turned off somehow?

Jeremy Clarke jer at simianuprising.com
Wed Jul 15 13:24:10 UTC 2009

I had a situation where I wanted to disable canonical redirect only in
specific situations (?cat=5&m=200805). My solution was to first check
if the conditions were right, then disable it only if necessary.
Disabling canonical entirely is a *terrible* idea! It's super awesome
in a ton of ways that are invisible to you most of the time.

On Wednesday, July 15, 2009, Davit Barbakadze <jayarjo at gmail.com> wrote:
> Ok, I think I've found good way to do what I need, I hooked up my function
> with lower priority (higher) then 'redirect_canonical'. I do what I need and
> then return handle to default action. Is it good and safe enough?
> Thank you for the tip.
> On Wed, Jul 15, 2009 at 3:16 PM, Jeremy Visser <jeremy at visser.name> wrote:
>> On Wed, 2009-07-15 at 14:49 +0400, Davit Barbakadze wrote:
>> > Today I noticed a strange behavior, which I have not noticed before. If
>> > permalinks are activated and you enter just one letter after last slash
>> > (like: domain.com/a) wordpress doesn't through 404 page, it
>> automatically
>> > redirects you to the first post with title starting with that letter (in
>> our
>> > example - with 'a'). Of course it useful in some cases, but in my it's
>> not.
>> > So... is there anyway to prevent that behavior?
>> Before you go disabling that behaviour, I would urge you to keep it on.
>> One really useful thing it does is redirect you if half the URL is
>> chopped off -- i.e. in an e-mail.
>> http://example.com/2009/01/01/hello- will get successfully redirected to
>> http://example.com/2009/01/01/hello-world/
>> Also, it gives you nice little shortcuts to your blog posts, akin to
>> something like TinyURL. If you write a blog post titled "Shepherd's Pie
>> With Tripe And Fish Oil", and its permalink is
>> http://example.org/2009/01/01/shepherds-pie-with-tripe-and-fish-oil/ you
>> can just refer people to http://example.org/shepherds-pie and it will
>> redirect.
>> But if you *really* want to disable that behaviour, you can use this
>> plugin:
>> http://txfx.net/files/wordpress/disable-canonical-redirects.phps
>> It's a one-liner plugin that just does this:
>>  remove_filter('template_redirect', 'redirect_canonical');
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> --
> Davit Barbakadze
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

Jeremy Clarke
Code and Design | globalvoicesonline.org

More information about the wp-hackers mailing list