changing wordpress URLs for a better library website 1

It will be no surprise to most of you that I’m all for using WordPress to power library websites. The list of reasons to use it is long, but there’s one thing of which I’m not too terribly fond. The URLs. I dislike when URLs/look/like/this/and/contain a bunch of words and slashes, and WordPress URLs can get to be that way.

Let me say straightaway that WordPress URLs can easily be changed from something ugly and useless like:

to something pretty like:

That’s what I use on this site just because I’m picky and I like how clean it looks. WordPress URLs can move beyond just being not ugly to being useful and informative. Something like:

Great! Moving beyond post numbers and putting content in the URLs is good for spiders indexing sites, right? This even prettier permalink arrangement uses WordPress page titles as URLs. It isn’t difficult to accomplish. Here’s the page in the WordPress Codex on Using Permalinks.

What’s not to like then? Even though they’re pretty, WordPress URLs can get long when pages are nested under other parent pages, especially if the page titles are more than one word. It would be possible to not have any nested pages, but it is useful for the sake of organization. I also do it so only main pages appear on the header of my library’s site.

North Plains Public Library

The URL for the Loan Periods page on the NPPL site isn’t too long:

but the URL to our Click-A-Story page is way too long. How are we supposed to advertise the program with a URL like this?

Yikes! That’s way too unwieldy to put on promotional material.

fun with 301 redirects

To use 301 redirects it is necessary to edit a special file called .htaccess. It is a little tricky making and or finding your .htaccess file, but the Codex has a great section called Where’s my .htaccess file?

My redirects are probably not 100% well formed, but they work. Here’s how I changed the long Click-A-Story URL into

Redirect 301 /clickastory

It’ll also work wonders for our wireless network adverts. changes to

Redirect 301 /wifi

To promote patron access to their accounts we can advertise instead of using the long Polaris URL.

Redirect 301 /account

While our library cooperative did a nice job making the URL to lead to a search page, will take users what I’ve found to be a more reliable search page.

Redirect 301 /find

Using these redirects to create URLs that are easy to print, remember and use is the best of both worlds. The real URLs contain good descriptive content for search engine spiders, and patrons have easy URLs. Hurrah.

what’s missing

I’d like to get a bit more fancy and use mod_rewrite for these redirects. mod_rewrite is an Apache server module that can manipulte and rewrite URLs. I tried to use it before and had a bit of success, but I’m not ashamed to say it isn’t easy. Even its own documentation calls it voodoo. With mod_rewrite, I’m pretty sure it would be possible to not only redirect from user-friendly URLs, but also display them in the address bar. If anyone wants to tutor me I’m all ears.

One more thing. Using redirects isn’t just for WordPress. I’m sure there are plenty of library URLs that could use simplifying and redirects also might come in handy when doing website redesigns. When you need to change the structure of your URLs that are already indexed, and in your users’ bookmarks, you can do so without fear of losing rank or causing 404s.

Happy redirecting! refreshed! 2

If you’re reading this via RSS you might not care but I’ve refreshed the look of Not a full redesign (I couldn’t bear to change the look!), but just some updates. Upgrading to WordPress 2.3.1 and K2 RC3 pretty much forced me to redo the CSS to make the site look how it did, but otherwise it was painless.

I’m forever telling people that library websites need to be friendlier, more fun and more human, so I decided I should model this behavior. The about section has some additional info and a picture of me. Font sizes are a bit larger, links are now a nice blue instead of red and I have a friendly greeting on the front page that includes a small photo. The archive page is gone, but the sidebar is more useful and includes a tag cloud. Navigation is better because of a maybe good, maybe annoying AJAX slider at the top of the page.

Hope you like it and let me know if you find any gremlins!

wordpress theme generator 1

My love affair with wordpress is still pretty much in full bloom because it is the right tool for so many blogging jobs. Do you like wordpress too but need a theme different from one of the many nice ones available? You could always hack one up to your liking, but if you aren’t up for that, take a look at the wordpress theme generator. By choosing items from simple drop down boxes you can create a custom theme. The generator will give you a zip file which you can unzip and upload to /wp-admin/wp-content/themes/.