Posts tagged as:

USD

If you are changing your permalinks structure differently than what is described below (e.g., going from name-based permalinks back to name and date-based permalinks), there is a WordPress plugin that can take care of you. If all you want to do is change from name and date-based permalinks to name-based permalinks, the method described below should be a bit faster, as the redirect is handled at the server level rather than at the PHP level.

This is a follow-up to my earlier post Seamless Permalink Updating. The problem I faced was that I wanted to change my WordPress permalink settings from being date and name based to something which was simply name based.

Why did I want to do this?

  1. Permalinks would be shorter; removing the date information results in URIs which are eleven characters shorter.
  2. Permalinks would not only be more readable, they would be more meaningful to humans; dates aren’t as important as the content the page itself contains. If presented with a list of permalinks from this site, users should have a good idea of what they’ll get when they click them. There’s no reason to muddy those waters by injecting date information into the mix, diluting the impact of the domain and post slug.
  3. The content part of the permalinks (domain name + post slug) would carry more impact in various search engines, without date information (that may or may not be recognized as dates by search engine algorithms) diluting the value of whatever keywords may be present.
  4. Yes, this is a blog, and yes information is posted chronologically; however, this isn’t a novel, and the material here need not be read in a chronological manner in order to understand it. Having date-based permalinks creates the illusion that the date the material was posted is more important than it really is. Besides, posts are displayed with the date anyway; why give it to the user twice when I’m betting the date included with the post is glanced over by most users.

Great reasons, I think, which should suffice for now. So I wanted to change my permalinks; what did I do about it?

WordPress makes the process ridiculously simple.

  1. Visit the Permalinks page of the administration panel (/wp-admin/options-permalink.php).
  2. Select the button labeled “Custom, specify below.”
  3. In the box labeled “Custom structure,” enter the text /%postname%/
  4. Submit the change via the “Update Permalink Structure »” button.
  5. Visit your site and verify that posts are not being given permalinks in the style example.com/post-name-here/. Beautiful, no?

Like I said, ridiculously easy!

But consider: What happens to all the links out there on the Internet to your blog which make use of the previous style of permalinks? Try it out for yourself; find an old permalink in your browser’s history that still makes use of “Date and name based” permalinks and visit it.

404! You broke the Internet! File not found! It’s the end of the world as you know it!

But don’t worry, you can feel fine about it because I have a solution, provided that you are using Apache as your server environment (chances are, you are) and mod_alias is enabled (I’m unsure how common it is). We’ll be fixing our problem using the RedirectMatch directive of mod_alias.

  1. Download your blog’s primary .htaccess file; most likely, it’ll be in the same directory as your blog’s wp-config.php file.
  2. Open it up, and find WordPress’ permalinks code. If you’ve never edited your .htaccess file before, it will most likely be the only code present. The code looks like this, give or take a line break:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
  3. Before that WordPress code, you’ll want to add one of the following:
    • If your WordPress is installed in your domain’s root directory (e.g., example.com/wp-config.php), add this code, adjusting example.com to your proper domain name:

      RedirectMatch permanent ^/[0-9]{4}/[0-9]{2}/[0-9]{2}/([a-z0-9\-/]+) http://example.com/$1
    • If your WordPress is installed in a subdirectory of your domain (e.g., example.com/blog/wp-config.php), add this code, adjusting example.com/blog to your proper domain name and directory:

      RedirectMatch permanent /blog/[0-9]{4}/[0-9]{2}/[0-9]{2}/([a-z0-9\-/]+) http://example.com/blog/$1
  4. Save & upload the .htaccess file, and revisit one of your older date-based permalinks. If all went according to plan, you should be seamlessly redirected to your new name-based permalinks.

That’s all there is to it! If anyone can provide a better means, I’m open to it, but I’ve tested this out, and it works exactly as I want it to — posts work, paged posts work, pages work, and so on. I can’t promise this won’t break any WordPress plugins, so be prepared to give up this method (which is as easy as deleting whatever you add to .htaccess and switching your permalink structure back).

For the curious, this is what the code above does, piece by piece:

RedirectMatch
Begins the call to Apache’s mod_alias module.
permanent
Sends the client (i.e., the user, whether human or robot) instruction that this redirect is a permanent redirect and that the old address is invalid and should be from now on replaced with the new.
^/[0-9]{4}
The address which we’re trying to match begins with a four-digit year stamp, so we first look for a slash followed by four numbers.
/[0-9]{2}
The address will next have a two-digit month stamp, so we check for another slash followed by two numbers.
/[0-9]{2}
The address will next have a two-digit day stamp, so we check for yet another slash followed again by two numbers.
/([a-z0-9\-/]*)
The address will then have the post slug, which can consist of a variety of lowercase letters, numbers, and dashes. So we look for any number of those. A post slug may include additional information after it, such as a page number on paged posts, so we include any number of slashes in our search as well. It’s enclosed in parentheses so we can capture that data and use it in the next section.
http://example.com/$1
This is the location of where we want to redirect to. The $1 at the end will be replaced by whatever was matched by the code in parentheses in the previous statement.

Edit: Whoops! Using the above RedirectMatch code prevented viewing of day archives (e.g., /2008/01/01/); swapping the asterisk (*) out for a plus sign (+) resolved the issue and allows day archives to be viewed. The code above has been corrected.

Popularity: 36%

{ 22 comments }

Hosting Plan Change

by Rick on October 4, 2007

Okay, I admit, this doesn’t affect you, my beloved readers, in any way. However, I wanted to point out that I just saved a bundle on my car insurance web hosting!

In celebration of their ten year anniversary, the greatest web host in the world (hosting such can’t-miss sites as, well, this one!) consolidated all of their shared hosting plans into just one, which they call the Happy Hosting plan.

Current customers are able to stick with their current plans or switch seamlessly to the new Happy Hosting plan.

Under my original plan (the “Code Monster” plan), I was essentially paying $15.95 per month, which was prepaid for two years. That’s $382.80 for all you mathematicians out there. If I were to pay monthly, it’d be $19.95 per month. Now, don’t get me wrong, for what the Code Monster plan offered, it was well worth it. I’m in no danger of ever running out of disk space even if I uploaded my entire music collection! Now, why I would do that, I don’t know; but it’s nice to know that there’s room enough to grow for as long as my sites exist!

It’s also nice to be able to provide free space to friends & family!

Those prices were the old plan, though. Enter the Happy Hosting plan! Now, paid monthly, I’m only being set back $10.95, which is a savings even compared to the discounted 2-year prepaid charge of the old plan! Greater savings can be had via prepayment on the new plan as well, which I may take advantage of in the future.

I just saved a bundle on my web hosting!

So I switched to Happy Hosting. But wait! I was already prepaid on the Code Monster plan up through the end of January 2008. Well, DreamHost being the awesome folks that they are, the “unused” portion of my prepayment was credited to my account. Now, under Happy Hosting, I’ve enough money in my account to last through to March before I need to worry about making payments. Awesome!

Okay, so that’s all well & good for me. Well, it can be good for you too if you sign up with ‘em! Chances are, they’re just going to keep bettering themselves & their service, and that’ll work out for your good in time!

Your $10.95 per month gets you all this & more:

  • 500 gigabytes of storage space! For some perspective, that’s enough space to store around 730 CDs’ worth of music… at CD quality! Oh, and every week your account is open, your space allotment grows by 2 gigabytes! (I have over 610 gigabytes at this point!)
  • 5 terabytes of bandwidth! Okay, so you’ve uploaded your 730 albums? Well, there’s 500 gigabytes used. You’ll still be able to download each of the albums nine times (or one of them over 6,700 times)! And of course, for every week you’re with DreamHost, that allotment grows by 40 gigabytes!
  • Unlimited… databases, domains (one of which comes free!), FTP/shell users, email accounts, and more!
  • And so much more!

What are you waiting for? More incentive? Okay, how ’bout this? Use the promo code RB1DOMAIN when you sign up, and you’ll get an additional free domain registration for life! You’ll also receive a certain amount off your hosting plan, depending on how you pay (monthly or over various prepayment periods)! Enjoy!

Popularity: 3%

{ 0 comments }

free writing

by Rick on August 28, 2007

I’m having one of those periods where I simply cannot focus. I sit down with intentions to blog, yet no words reach the page, so to speak. As I went to sleep yesterday, for about 30 minutes my thoughts were on closing down all of my sites and focusing my attention on my wife’s site, on Justin’s site, and essentially on serving rather than trying to figure my own things out.

I blame the miserable mix of allergies & heat on that whole period of thought.

Frankly, I enjoy blogging — reading them, writing in mine, and following the development of the software involved. (Whatever happened to Habari?) I can’t wait for WordPress 2.3 & native tagging support.

I wonder if I’ll ever use it.

I’m getting bored with my Cars diecast toys checklist. Maybe I’ll just strip that whole section down to simply the downloadable checklists and let the collectors battle among themselves for all the various details. I don’t own a single one of the toys; frankly, I have no interest.

And to all those grownups who spend their time collecting these toys & Hot Wheels & similar, I pity you. If you have that kind of money to waste on toys that no one’s going to play with, why don’t you donate it to someone? I’m sure there are plenty of families which cannot afford toys for their children; why not buy them some toys? I’m reminded of what Paul said; when he became a man, he put away childish things.

And speaking of childish things, I’m going through an entertainment crisis. Yeah, I know I’ve reviewed movies here, and I’ve allowed myself to be convinced of their “okay-ness” by the Emergent Church “fact” that we should embrace the culture in order to engage the culture.

Yet at the same time, I’m challenged & convicted by more biblically-oriented teachings such as hollywoodandgod.com. It makes sense. Should media be patronized which takes the name of the Lord in vain? Such is ubiquitous in our society, no doubt. I confess to using “God” & “Lord” as interjections far too often.

But Yahweh’s warning leaves no doubt as to how He feels about the practice. Read the Decalogue again (Exodus 20); Yahweh says He will not hold blameless those who take His name in vain.

So what does my dollar paid to Hollywood (or the book industry or whatever) say when I patronize those things containing blasphemy?

Maybe they say “I’m just paying for the movie; it’s not like *I’m* doing the blaspheming.”

Or “Exodus 20 is so Old Testament; here I am, entertain me.”

Or maybe it says that I’m complacent in my beliefs — neither hot nor cold, but disgustingly lukewarm, worthy to be vomited straight out of Yahweh’s mouth.

Frankly, I don’t know. Judging by Exodus 20, it seems far too important to ignore, however.

Heat. Heat. Heat. Lord, give us rain.

Ooh, such a headache. I can tell it’s making me a bit more bitter as I write; does that come through much when you read this? Are you reading this? This far in? I’m impressed.

I haven’t free written for about six or seven years, I think. We learned about it one of our language arts classes in high school. Just write. Think as little as possible. Don’t question yourself. Don’t check spelling. Don’t worry about grammar. (Those last two things are difficult to “turn off,” unfortunately).

I’ve heard that some people think free writing is too “occult,” that by “not thinking” about what you write, you’ll end up being used as a channel for demons to speak through.

And while I believe in demonic activity probably more so than your average Christian, here I am free writing.

Having understanding about the Scriptures is better than having superstitions thereof.

Why are people so apt to say they’ll help with a project but disappear soon after it’s set up without ever contributing?

I’m close to taking down my blog from TimothysBurden.com; that’ll give me three nice domain names that I don’t know what to do with. The others are ReadyScribe.net and Watch-Therefore.com. Justin, if you’re reading this, I’m offering one of those domains to you so you can get your blog off of the subdomain & onto a true domain. If you’re interested, drop a comment and I’ll get it all switched over. Your blog’s got a lot of potential, and I want to help you develop it.

Oh, I also have City-of-Connersville.com and phpBB-Wiki.com; I’ll likely let them expire. They certainly won’t have been the first of my domains to go by the wayside!

My dad mentioned he wants me to host (and develop?) a new website for him after he moves and starts operating his home improvement business from the new location. Neat. He wants me to charge him, though. How does one know what to charge? I’ve more hosting resources than I know what to do with, so that part isn’t any problem at all; though, I don’t deny that having the extra money to alleviate hosting costs would be A Good Thing. Ah, business. ($382.80 due sometime in February of ‘08 for the next two years of hosting; joy.)

A song from Falling Up’s remix album “Exit>Lights” just began; that’s the only album of theirs I’ve ever heard, and it’s awesome. I wonder if their original material lives up to the remixes. If so, I look forward to sometime hearing more of them.

I just realized I’ve been adding paragraph breaks. I don’t think free writes are supposed to be formatted thus.

Oh well.

Popularity: 5%

{ 3 comments }

I just caught a brief glimpse of an Oprah Winfrey show with special guest Al Gore. The crux of the show was that we need to be more green in our lives by making small changes which result in noticeable & positive net effects. “Time is of the essence.”

I encourage everyone… Anytime you hear someone on television claim we need to go green, turn your television off. Frankly, I’m curious if they’d still want you to go green even after their ratings plummeted due to the active energy conservation of shutting off the teli.

I have nothing against environmentalism. I believe in being actively wise in how resources are consumed. I further believe that part of what we will be held accountable before God is our stewardship of what He has created.

And if celebrities want to push “greenness” through their multiple-million dollar productions which likely consume more resources than I’ll use in a year (if not several years) to plan, produce, and market… Well, I’m not buying it, and you shouldn’t either.

Popularity: 3%

{ 0 comments }