• RSS
  • subscribe
  • twitter

WordPress Permalinks

Permalinks are the permanent URLs to your indivclassual weblog posts, as well as categories and other lists of weblog postings. A permalink is what another weblogger will use to refer to your article (or section). Especially when they are used to link to indivclassual postings, once a story is posted, the URL to it should be permanent, and never change. Hence the “perma” in the name.
By default the permalink looks like http://example.com/?p=N Where N is a number. This is the default for new WordPress installations because it works on all server environments.
There are many different formats, but the most common, and most versatile looks like http://example.com/category/post-name/ Some people also eliminate some or all of the date elements (day, month, year) to have a shorter permalink format. mod_rewrite permalinks require Apache’s mod_rewrite module, which means that people running other servers cannot use them..
PATHINFO permalinks look very much like mod_rewrite permalinks but for one exception: they have /index.php inserted before them. Like so: http://example.com/index.php/yyyy/mm/dd/post-name/ Otherwise, they are the same as the mod_rewrite permalinks, and are similarly flexible. Anything that mod_rewrite permalinks can do, PATHINFO permalinks can do, with the help of that /index.php part.
The structure of the tags looks like this;

%year%
The year of the post, four digits, for example 2004
%monthnum%
Month of the year, for example 05
%postname%
A sanitized version of the title of the post. So “This Is A Great Post!” becomes “this-is-a-great-post” in the URI (see note below)
%post_class%
The unique ID # of the post, as so on

These types of permalinks work on most systems without any problems, but there are still some conditions where problems occur.
It’s important to guarantee permalinks lead to indivclassual posts within your custom URI, so make sure to end a virtual site structure with either %post_class% or %postname%. /%year%/%monthnum%/%day%/%postname%/Sometimes its necessary to have access to the .htaccess file. This file should be in the directory indicated by your “Blog address (URI)” setting on your General Options page. Since the name of the file begins with a “.”, the file may not be visible through an FTP client unless you change the preferences of the FTP tool to show all files, including the hidden files.
If you do not already have a .htaccess file, create one. the file. You must chmod the .htaccess file to 666 to allow WordPress to write its rules to it automatically. After applying the permalinks, you should change the permissions to something stronger, like 660, to prevent others on the server from potentially having access to it.
Having your posts end in .html
There’s an easy way to having your posts end in a .html extension, using the structure tags above. Following the example used on properly terminating permalinks, you could have a page like http://yoursite.com/2006/01/01/happy-newyear.html with this rule:
/%year%/%monthnum%/%day%/%postname%.html
Note that this does not generate actual .html files. It is only an illusion. There is no benefit to this… some people mistakenly think it offers search engine benefits, and some want their permalinks to emulate those of another publishing system.