Permalink Redirect WordPress Plugin 0.5
I have finally had a chance to update my Permalink Redirect WordPress plugin. The new release is 0.5 which has some bug fixes as well as new features.
/author/%author%/should work properly now. It was broken in WordPress 2.0 due to changes in userdata cache.- Permalink Redirect page under Options menu. Currently it allows you to put in regular expression patterns for URI to skip matching and redirecting. You might have some special path that you do not wish Permalink Redirect plugin to touch — just put them in there.
Thanks to all who have reported bugs.
Links to This Article
Comments
The author page is still not working. it only displays author pages when the author has written a post. But not a author page of someone who has only registered of responded to post
for example on these pages:
http://www.ochblog.com/members/
and
http://www.bangkoktalk.nl/alle-leden/
I am using your version 0.5.3
Vincent,
Check whether it works *without* the plugin.
From what I have seen, it is redirecting to the right URL, but because of the way WordPress’ “the loop” works, if there is no article in archive (for that category, author, date, etc), it will produce a 404 on that page.
Yes it works without the plugin, that is the whole problem :-)
I personally do not mind if there is an exception for the author pages = no permalink structure for these pages. But I haven’t got a clue how to write an exception.
The problem is also discussed here:
http://wordpress.org/support/topic/64766?replies=4#post-397299
I have had a look at the code, and have guessed that the issue is with how WordPress handles 404 response.
With permalink-redirect plugin enabled, it automatically redirect any author request to the author’s “permalink”, i.e.
GET /?author_name=foobar
will raise a “301 Moved Permanently” to
GET /author/foobar/
However, in WordPress (2.0.3 at least) wp-includes/classes.php WP::handle_404() function, if the post count is 0, it will send back “404 Not Found” message, UNLESS there is a query string.
Therefore, while /?author_name=foobar gets a 200, /author/foobar/ gets a 404, even though foobar is a valid author but without any post.
I think it is more a WordPress issue than a Permalink-Redirect issue. The same applies to category archive — a category without any post will get a 404 if you access its permalink.
You can, however, by-pass redirecting from query-string URI to permalink URI for author profile pages, if post count equals 0. Open ylsy_permalink_redirect.php, and around line 94 (for version 0.5.3):
$author = get_userdata(get_query_var('author'));
- if ($author === false)
+ if ($author === false || count($posts) == 0)
return false;
It will then not redirecting for author profiles if author does not have any post.
I’ll put in this hack in the next permalink-redirect plugin, but I do see this as a problem of WordPress’ way of handling 404.
I am having a very strange problem with my established WordPress (2.0.4) installation at http://www.drewvogel.com. If I go to Options>Permalinks, my permalinks stop working (even if I don’t click “Update Permalink Settings”). Simply viewing the Permalink settings page is enough to break it. This is 100% reproducable. The server is a Fedora Core 5 server with all the latest patches.
Can anyone help me to fix this problem?
Add a comment
Gravatar is used. Email address is required but will not be displayed. Please keep your comment on topic. No spamming and/or bad language. First time poster will be moderated. Scott reserves the right to delete/edit your comments.

Hello Scott,
I looked at your plugin before, and just now it might do what I need it to do ;), but before I start changing all kinds of things on my server, just a quick check:
Right now I have this directory structure on my server:
/ (just a redirect to /weblog)
/weblog (my wordpress folder)
/weblog/archives (all of the content, posts use absolute urls to this content, which is made up of /200502 and /200503 style of folders and contain things like imagesm flash, videofiles etc.)
To skip the ‘body onLoad’ redirect on the first page of the domain (www.spoenk.nl/) I wanted to move all of my wordpress files to the root of my site. This is no problem. Then I added a 301 permanent redirect in a .htaccess file inside the /weblog folder. This also went ok (as expected), but everything redirected to just the index.php file without any of the ?p=201. At the same time I decided to start using permalinks, which caused another problem. But the biggest problem is that no images whatsoever were included into my pages because the redirect also redirected every request for content inside /weblog/archives. And I can’t move that content because like I said it contains years of absolute urls.
Can your plugin handle this kind of thing? If so, great! If not, well, then I’ll just stick to the current setup ;).
Thanks.