Working Permalinks With WordPress In It's Own Directory

I spent half the morning yesterday trying to get this to work. Now that I have, I thought it’d be a good idea to document it here. Not only might I need this again later, but it might be useful to someone else.

My Objective:

I had a two part purpose here. I wanted to be sure my mod_rewrite permalinks functioned correctly, as well as having the root of my website(www.waitingforfairies.com) redirect to the WordPress subdirectory.

My Process:

First, I tried putting WordPress in it’s own directory. This didn’t work for me. Mostly because of the problem and solution for GoDaddy hosting found here, which I’ll get to explaining later.**

To cut a long story short, here’s what I did:

Part 1: Setting Permalinks In WordPress

  1. I moved WordPress completely into it’s own directory. It’s now physically located at http://www.waitingforfairies.com/blog.
  2. I set my permalinks to what I wanted via the WordPress administration panel. In my case, I used the date and name based option: /%year%/%monthnum%/%day%/%postname%/
  3. There is now an .htaccess file in that WordPress directory with the following code:

# BEGIN WordPress

RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]

# END WordPress

This part is pretty standard, and you can find it in a hundred places if you look.

That resolves part 1 of my objective: to make sure the permalinks work the way I want them to. Now, for part 2: powering the root of this website with WordPress.

Powering The Root With WordPress

  1. I created an .htaccess file in the root directory of my blog.
  2. It’s powered by the following code:

# Turn on rewrites.
RewriteEngine on# Only apply to URLs on this domain
RewriteCond %{HTTP_HOST} ^(www.)?waitingforfairies.com$# Only apply to URLs that aren't already under folder.
RewriteCond %{REQUEST_URI} !^/blog/# Don't apply to URLs that go to existing files or folders.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d# Rewrite all those to insert /folder.
RewriteRule ^(.*)$ /blog/$1# Also redirect the root folder.
RewriteCond %{HTTP_HOST} ^(www.)?waitingforfairies.com$
RewriteRule ^(/)?$ blog/index.php [L]

This code effectively reroutes anyone who visits the root of my website directly to my WordPress blog. Voila: Working WordPress permalinks AND WordPress functioning as the root of the site from within it’s own directory.

If you use this method, you’ll need to replace each instance of waitingforfairies.com with your domain. You’ll also need to replace each /blog/ with the name of the subdirectory where you’ve installed WordPress.

And that’s it. Except for one thing…

**Part Three: GoDaddy Hosting and .htaccess

The above referenced article was a sanity saver for me. The reason why I’d spent half the day on this is that I hadn’t realized this about GoDaddy:

NOTE: Changes made to an existing htaccess file will be seen immediately. When a new htaccess file is created or an existing htaccess file is deleted, however, these changes will not be seen until the htaccess cache is cleared. This occurs every hour.

Once I knew this little piece of trivia, the rest became easy. I realize that my method is only one of many. I further realize that anyone with experience will be able to write this code themselves. But that’s what’s great about WordPress. You don’t have to be a guru to do cool things with your website. And if you do happen to be a guru, you can still do cool things with your website without having to reinvent the wheel. So I hope having this information all in one place will benefit someone, somewhere, somehow. Giving back is a good feeling.

Waiting…

I know the About Page says quite a bit about the name of this website, and what it says and what it means; but somehow, I feel like it doesn’t quite say enough about what it needs to. It doesn’t portray the years of hope and longing to be something more significant than just a girl in Ohio. It doesn’t tell you about the agony of spending your life ‘Waiting for Fairies’.

I grew up in a tiny town in South-Western Ohio. My dad was a mechanic, of sorts, and my mom was a stay-at-home mother until my little sister was old enough to go to school full-time. Have you ever heard the term ‘welfare Christmas’? Because that was us. I think it was too far back for Toys for Tots, but I commend those people. I didn’t find it embarrassing at the time that we got gifts from the government for the holidays. I just thought it was kind of cool to get presents two days of the year. One was government-paid, and then the actual holiday when grandparents and aunts would send their own gifts. It’s vaguely embarrassing now, but there’s no real reason to be ashamed. We were poor. I got Wal-Mart clothes for school, but we had enough for supplies. I wasn’t the kid sitting in the back row of class who had to borrow pencil and paper, and didn’t even have a backpack to carry home his textbooks.

My parents learned early on that the more books they let me bring home from the library, the quieter I would be. Fights with my sister didn’t count, of course. I still remember the very first book I ever read on my own: The Swan Princess. I devoured the children’s section by third grade, and I’d gone through all of the Young Adult shelves by the middle of fifth. That means I was around ten when my mom finally started letting me borrow her Stephen King books. I tried to read Pet Cemetary, but I kept falling asleep. I shocked all my teachers when I carried in King’s 1100 page epic: It, and I shocked them again when I let them know I was actually reading it for the second time.

My mom never forbid me from reading anything I could get my hands on, though she later discouraged the occult books I picked up. Her explanation to me was this: “If you’re old enough to pick it up, you’re old enough to read it. You may not understand it, but you can always read it again when you get older.”

That’s how I got Freud while I was in middle school. Studies of religion and mythology before I was 14. But my favorites? Science fiction, and especially fantasy. LJ Smith, Anne McCaffrey, Mercedes Lackey, David Eddings– and dozens upon dozens of others. Everything with one of those blue “fantasy” labels on the spine were fair game. I searched through the adult fiction, the YA section, everything. I’d say that I read them all, but they were always adding more, so I can’t say for sure. It was quite a lot, for a small county library, anyway.

Everything I’d read just compounded in my head, and I wondered what was going to be special about me. I read fanciful accounts of kids picking up books in the library on ‘So You Want to Be A Wizard’? There were stories of young women being wisked away to save an alternate reality. People with special abilities: Everything from fire magic to telekinesis.

And I wanted it.

I wanted the magic, the purpose, the ability to be something other than I was. I think I’ve spent at least two decades wondering when it would be my time to be ‘special’. The wanting faded, eventually, from wanting some fantastic life, to wanting to just be something more than normal. Then, I realized that the feeling is normal. Everyone wants to make a mark. Everyone wants to be something special. The difference between wanting and being, is doing.

So this website is me doing. I’m reshaping my life, striving after that goal to be something special, someone who makes her mark on the world. I guess that when I got married, I realized that one part of my life had finally come together. I no longer needed to devote time and energy to being absolutely perfect in order to ‘catch a man’.

Tip: That’s not how I caught mine anyway!

Essentially, for the first time ever, I was 100% content with one portion of my life. Why wasn’t I content with the rest of it? What could I do to fix that? That’s what I spent a long time asking myself. I’m still trying to figure out the complete answers. This site is a journey, not an ending. It’s my admission to myself. Waiting for fairies to come whisk you away to the Ever After doesn’t happen in our world. If you want magic, light, mystery, happiness and contentment… You have to go out looking for it. And that’s what Waiting for Fairies is all about.

Officially Tossing in the Towel

In case you hadn’t noticed, I’ve officially given up on NaNoWriMo. You’ll notice that there haven’t been any updates here since day 6. That would be because I gave up on day 8, after two days of no writing. I haven’t given up on the story. On the contrary, it’s become one of my favorites, and I hope to be able to devote all the time and energy that it deserves one day.

Alas, today is not the day. Nor is this month the month in which that novel will see it’s glory. Maybe next year. I just have way too much on my plate right now, unfortunately. With that said, I hope to be able to give this newborn site a little bit more of my love from now on.

If it’s not said plainly on the About Page, Waiting for Fairies is a website devoted to my many varied projects, as well as to record tips and tricks that I pick up on the way. These ‘projects’ consist of many things: various writing and short stories, my efforts to become more proficient in web design, and any other crafts that may come to mind. This is my place to display my work… My portfolio, if you will.

On that note, I’d like to mention that I’m currently working on a great new {original} design for WFF! The basic layout has been completed. I need to pretty the whole thing up, as well as add a few bells and whistles. I’d say that, day job allowing, we’ll have a new face here at Fairies in a couple of weeks. I hope you’ll stop by again to give it a look.