Come in, sit down and discuss the burning topics of the moment! (Online Since May 30, 2007)

Update on Changes to John’s Joint


Friday, August 21st, 2009

This discussion will include some technical details for any of you who might be as “geeky” as John or me. <grin!> (See John’s “About Me” page for links to a couple of tests to find out how geeky you are.) The tech details will be at the end of the article.

The problem with the category pages has been solved. As stated in the previous post, the link to an article (the “permalink”, also called Uniform Resource Identifier or URI) was changed from the default form of “ht…am.org/?p=100″ to “ht…am.org/politics/apologies”. That “broke” the links to the categories pages.

Since that problem has been resolved, it was decided to make one more change to the permalink structure. The post ID number is now appended to the post name, so the final URI for John’s “Apologies” articles is in the form “ht…am.org/politics/apologies-100/”. All other articles, both those already posted and any posted in the future, will have a similar naming scheme for the URI.

And an additional change was made. Any post can also be accessed by a URI like this one: “ht…am.org/post/100″.

So John’s “Apologies” post can be read by using any one of the following three links:

http://geofam.org/politics/apologies-100/
http://geofam.org/?p=100
http://geofam.org/post/100

Now, for the geek stuff…

…Apparently, the “Advanced Permalinks” plugin had a setting wrong that caused an endless loop when a link to a category page was clicked on, so WP timed out and said that nothing could be found for whatever category. The wrong setting was one that creates a 301 redirect from the old permalink structure to the new. When changing from the default form (ht…am.org/?p=100) to the new form (ht…am.org/post/100) the 301 redirect is unnecessary. So changing the errant setting fixed the problem.

The third form of the URI (permalink) was added by placing a line in the .htaccess file that rewrites a URI from the form “ht…am.org/post/100″ to “ht…am.org/?p=100″. For the really geeky among the readers of this blog, here’s the line:

RewriteRule ^post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA]

It simply replaces “/post/100″ with “/?p=100″ before sending the URI on to Wordpress so that WP can find the article in its database.

The title for an article is used to automatally generate the name used in the URI. All spaces, apostrophes, and other characters that can not be used in a URI are changed to hyphens and the post ID number is added, also with a hyphen in front of it. Common words, such as “the”, “it”, etc. (there is a list of several hundred) are removed before the spaces are replaced with hyphens. This makes it easier to find a particular article. For instance, looking at the URI for the above-mentioned “Apologies” article will tell you right away that it has to do with “Apologies”, while looking at the original default URI with the “?p=100″ doesn’t tell you a thing about the content of the article. As an added benefit, using this URI naming scheme will result in better search engine rankings when someone does a search for words that might be in the title of the article.

The official Wordpress documentation about permalinks can be found here. (Opens in a new window.)

Don’t go away! Some changes in the theme are next.

Marv

PS- I keep using the link to John’s “Apologies” post for examples in the articles about changes to John’s Joint because I think it is one of the best articles on the Internet. Great work, Bro!

Link To This Post
1. Click inside the codebox
2. Right-Click then Copy
3. Paste the HTML code into your webpage
codebox

Related Posts:

Tags: , , ,

Leave a Reply