When WordPress Permalinks 404

The 404/Not Found error message is one of the most hated screens on the Internet; it indicates that though you, the browser, were able to communicate with the server, the page you need was not delivered either because it was not found or because the server for some reason was configured to not fulfill the request (which is happening in some countries with pages containing illegal content).

The page you actually see is not generated by your computer; instead, it is a special page on the server you’ve tried to contact. Many web sites create their own special 404 pages either for artistic reasons, or because the site owner wants to put specific data, like contact or redirect information, on the page. In Apache, having your own special 404 page is as simple as modifying the .htaccess file. (The only caveat: the page must be larger than 512 bytes or IE will not display it.)

In most cases, the 404 error comes up when a page has been moved or deleted from a site. However, in the case of WordPress, an annoying bug can cause permalinks to point to the 404 page instead of the page you want to have it bring up.

How Do WordPress Permalinks Work?

Permalinks are permanent URLs generated to point to your individual weblog posts, categories, and weblog lists. Other bloggers will use a permalink to point to your post from their own articles, or you can send links to other people via a permalink. When they are linked to an individual post, the URL is supposed to be permanent, not dynamic (changing).

The three types of permalinks WordPress delivers are the Default (aka “Ugly”) form, mod rewrite (“Pretty”), and PATHINFO (“Almost Pretty”).

Default links are formatted according to the default settings of a new WordPress install, and will work on all server environments. It looks like this: http://example.com/?p=N , N being a number. It is neither neat nor elegant, but it does the job. Pretty mod rewrite links look more like this: http://example.com/yyyy/mm/dd/post-name/ . These permalinks require Apache’s mod_rewrite module, and won’t work on other server types. PATHINFO permalinks look like this: http://example.com/index.php/yyyy/mm/dd/post-name/ , and will work on other server types besides Apache.

Because you’re going from a dynamic to a fixed environment with your permalinks, a variety of things can go wrong with them. For instance, if your server includes Frontpage Extensions, permalinks will not function at all without doing a manual fix. Without this fix, any changes to the permalinks section from the WordPress admin interface will corrupt the Frontpage server extensions because it interferes with the .htaccess file.

Long permalinks can get chopped off as well, with only part of it working properly or with the entire link disabled. This will cause a 404 error to be generated – but not because there’s something wrong with your permalink, rather because the title is too long. You can fix it by editing your .htaccess file to add a line:

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

You can also make a habit of posting URLs with angle brackets () on either end. Most email and other problematic software won’t truncate URLs formatted this way.

Permalink Structure in WordPress

When your links don’t work, it’s often because you didn’t update your Permalink structure. Every time you add a new static page to your WordPress files, you must generate and update new rules to the .htaccess (which in newer versions is taken care of through the admin control area). If you don’t get a page returned at all, even a 404, and you use PHP 4.4 or 5 with Apache 2, you should look that up in the PHP bugs and issues pages. This is a specific known bug.

When you’re creating permalinks, another strange thing can happen: your WordPress blog must start the process of creating a permalink before it knows whether or not the page you’re creating one for actually exists. If it doesn’t, too late – your link is already pointing at a 404 page. To repair this, you need to include a 404 direction in the header of your .htaccess file so that your rewrite conditions allow for a not-found error, and simply eliminate that page from your permalinks task. Try adding the following line above the WordPress rewrite rules, outside of #BEGIN WordPress[…]#END WordPress. Some plugins will overwrite this part if you edit the permalinks structure if it’s in the wrong place.

ErrorDocument 404/index.php?error=404?

Another solution is to use this following:

ErrorDocument 404/foo/index.php?error=404

foo = the directory you are using as a blog. The structure should be like this:

/foo/%category%/%postname%/

If you call a nonexistent directory, however, you’re still going to get that 404 permalink.

You can automate your permalinks tasks with several plugins, though. The Ultimate Tag Warrior (UTW) has gotten some good reviews, especially for search-engine sensitive pages. Google Sitemaps is a good plugin as well.

One more thing: if you use the xampp setup, your WordPress permalinks won’t work at all in the default installation..

The ultimate solution is actually to install WordPress 2.0.2; this new version has repaired the permalinks problem as well as a number of other problems.

Always double-check all your pages before you start working with permalinks, and after you’ve permalinked them. In some cases, you may have to delete all the permalinks and start over, but in most cases just taking a look at what you’re telling your server to do will prevent you from making a lot of stupid mistakes.

 

The WordPress Plugin Repository

WordPress is a great open-development community that encourages its users to innovate. But a few years ago, it started getting hard to keep up with those innovations. That’s when the WordPress Plugin Repository was born (currently hosted at http://WP-plugins.org).

The repository is a place where all WordPress plugins are pulled together and shared with the community of users. But more than that, it’s a place where developers can go to see what’s already out there, what they can base their new work on, and what needs to be improved. In addition to end-user utilities that anyone can download for their WordPress needs, there are plenty of development tools, including wiki-based version control and a bug tracker, that the WordPress development community is welcomed to use. Everything is licensed under GPL unless noted in the source, so almost everything is open.

If you’re new to the WordPress plugin repository but not to the WordPress support forums, you should login with your forum username and password; they are currently synced. If you have any problems, you should email the forum webmaster to ask what’s going on. Only logged-in users may edit on the Repository, though everyone is welcome to view what’s going on.

What’s Available on the WordPress Plugin Repository?

The Repository is designed to be a complete, organized, efficient method of seeing what’s in development and what has been developed for WordPress. As such, the core offerings here are the plugin directory and a robust version control mechanism. You can also use a special interface, downloadable for free, to work with the Repository more easily. The Repository is powered by Trac, a source control management and project management tool. Subversion is a wiki tool providing version control, and is also the source management tool WordPress is using today.

Developers using this directory can host all their WordPress developments for free, even organizing teamwork through the WordPress Plugin Repository. By hosting here, they have high visibility, can easily manage their code and track bugs, and develop wiki-based documentation with end users more easily than they could ever do it by themselves.

But developers without users are like stores without customers. WordPress users, too, are welcome to download plugins that are in alpha or beta form, or to download and use the plugins that are fully-functional but not integrated into WordPress yet. There are tools available for users to:

• Browse plugins and themes available at the Repository
• Download all desired plugins and themes from one stable location
• Give their own feedback and suggestions to developers by using the tracker.
• Help develop documentation and improvements by using the plugin’s wiki page.
• Know what’s going on at all times by using RSS feeds.

Anyone developing or looking for WordPress plugins and themes is encouraged to use this resource. An email will get you the hosting you need for your project, and just coming and looking around will tell you a lot about what’s going on in the WordPress development world.

What Plugins Are Available Right Now?

While plugins are changing fast, a few core plugins are available and certainly worth the time they’ll take to check out. The best ones right now include:

Main Categories for WordPress allows you select “main” categories on your blog’s navigation bar. This allows you to highlight the parts of your blog you find most important, while still displaying everything else.

The WordPress DBManager manages your WordPress database so you don’t have to. Instead of worrying about lost data, you can use this manager to optimize, back up, restore, delete backed up databases, and even run queries for specific data.

WordPress Email allow you to send your blog entries to friends, enemies, or anyone you choose.

WordPress PageNavi gives you advanced page navigation.

WordPress Polls allows you to run the ever-popular polls and make the results public when you’re ready.

WordPress PostRatings allows you to have rating systems for your blog posts.

WordPress PostViews lets you display for users and for yourself how many times a post has been viewed.

WordPress Print will display for the user a printable version of any given WordPress blog post.

WordPress RelativeDate displays a relative date beside your post or comment actual date.

WordPress Stats displays WordPress statistics you want to brag about.

WordPress UserOnline allows you to note which users are currently browsing your blogs

WordPress Wap allows you to use a Wap-enabled cell phone to brows your WordPress blog entries from anywhere.

Other projects that are in development include:

• Joystick controls
• RPMView
• A WordPress XHTML validator
• Tons of tools for Python, including MySQL tools
• Recording level monitor
• An admin themer
• A post editor enhancement
• Fix broken links
• Palm usage manager

There are always new things in development in the repository, like new themes and small fixes such as a way to make WordPress allow dashes.

Even if you’re not a developer or interested in expanding your blog beyond what it has now, it is a good idea to check out the Repository. It’s certain that many of the plugins provided or in development today will eventually be incorporated into the newer upgrades of WordPress. By keeping an eye on the Repository, you’ll know what new developments are around the corner – and by logging in and discussing them on the wiki logs, you’ll be able to give your own input regarding how things ought to be done. While there are other places to find WordPress plugins, it’s to be hoped that most people will use the Repository in the future, making life easier for everyone.