WordPress URL Shortcuts

I learned something today that might be beneficial to anyone who runs, or visits, websites running the very popular WordPress software package: it creates shortcuts. You see, I was attempting to type the url for my super secret stats page: http://www.justincox.com/mint/ but instead accidently typed in http://www.justincox.com/min. Instead of getting the 404 error, I was redirected to http://www.justincox.com/2008/mint-worry-free-money-management/. Curious, I attempted a few more ’shortcuts.’

/gen took me to /2008/generation-kill/

/aug took me to /2008/august-blog-o-rama/

/fresh took me to /2003/freshmen/

It looks like this only works with the actual post slugs and not the post title. For example, the Freshmen article originally had a slug of /forums-flashback/. Typing in /fresh returned a 404 error. When I typed in /forums it worked. After changing the slug to freshmen the /fresh shortcut found the article in question.

I’ve also tested this on Two Slashes and it works there too. We’re both running WordPress 2.6.1 so I don’t know if it goes further back, but I have only noticed this since upgrading a few days back.

Find any other cool ’shortcuts’ around here? Try out some word combinations in the URL bar and let me know what you come across in the comments below.

"WordPress URL Shortcuts" was posted on August 27th, 2008. I hope you enjoyed it. If you did, please leave a response or subscribe to the RSS feed.
This post was tagged with: , .

Comments

There are 3 responses to WordPress URL Shortcuts

Nick Tabick

8/27/08 at 1:20 pm

Not to be a killjoy or anything, but this works on your site (and more recently mine because I finally got around to fixing it) because we both have the appropriate WordPress and .htaccess configuration for custom permalinks.

I don’t have the time to go digging into the PHP at the moment, but I presume it looks up post slugs that match what was passed via the URL and returns the first match. At least, that makes the most sense to me.

(Also, on a different note, you typoed the word ‘freshmen’ above in both the URL and the link text, so the link to your previous post is useless unless people are looking for your 404 page.)

JD Hartley

8/27/08 at 1:37 pm

On one of my blogs, we are set up using /%post-id%-%post-name%/. In this case, it only looks at the post id. You can type “23-blahblahblah” and it would still be the same page as “23-my-post-title”.

Justin

8/27/08 at 2:02 pm

@Nick Tabick: I hadn’t thought it had anything to do with the custom permalins, but that makes sense. It’s still a cool ‘feature.’ And thanks for catching the typo. Link is corrected.

Leave a Response

This site is powered by Wordpress and Corked 2.0
All contents, including design, are © 2001-2008 by Justin Cox.
HTML | CSS | RSS | Policies
(Log in)