Site is back online!

It’s a Christmas miracle!

Business-Open-Sign

So yeah… this is awkward. What was supposed to be a quick move to a new web host kinda sorta turned into a “I’ll get around to it later” move… that lasted 8 months. Sorry about that. :/

I hope we can still be friends, at least?

Pretty Permalinks, WordPress, and EasyCGI

As it turns out, not many folks are using WordPress on an EasyCGI hosted IIS server, so getting “pretty permalinks” to work properly was a bit tricky. Combine that with the fact that I know very little about this stuff, and things got a bit interesting. However, after a bit of research, patience, and tech support, I finally got it all working.

First of all, EasyCGI’s Windows-hosted IIS servers do not support the mod_rewrite method that most folks use for permalinks. (I figured that out pretty quickly.) I then tried this fix, but I had no luck with it.

I finally ended up using the custom 404 page method described here, here, and here. Those sites all link back to one other, so I’m not sure which one originally cracked the code, but I’m glad they did!

Specifically, I ended up creating a custom wp-404-handler.php file and placed it in my root directory. Within it I inserted the following code:

<?php
$qs = $_SERVER['QUERY_STRING'];
$pos = strrpos($qs, '://');
$pos = strpos($qs, '/', $pos + 4);
$_SERVER['REQUEST_URI'] = substr($qs, $pos);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include('index.php');
?>

I then accessed my IIS Admin Console (via EasyCGI’s control panel), and I configured the custom 404 error page for the “/wordpress” directory (my chosen installation directory for WordPress) to point to “/wp-404-handler.php”. I originally tried creating the custom 404 file in the “/wordpress” directory, but after some trial and error, I found that it only works when placed in the root directory.

For what it’s worth, I also tried the updated and longer version of code found here, and I can confirm that it works, too. However, I decided to stick with the shorter version because (1) it works and (2) it has less code. While it may not be as “robust” as the longer code solution, my thoughts are that it may be more efficient in the long run. Maybe I’m wrong?

Throughout the process, I contacted EasyCGI’s 24×7 live chat support, and they responded immediately and were very quick to assist. Their original solution was to place the following code into an httpd.ini file, which is the same code that would go into an .htaccess file when using the “usual” mod_rewrite method (that IIS doesn’t support):

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

However, that didn’t work for me, so they created a support ticket and one of their higher-level techs got involved. His original solution was to just settle with the “almost pretty permalinks” (which includes index.php in the URL), but I told him about the custom 404 page method. He looked into it and helped me get all of the code in the proper place. Overall, I am very pleased with EasyCGI’s tech support!

The only quirk with the custom 404 page fix is that invalid URLs now land on a blank page. I’m not sure how to fix this (or if it’s really a problem). In the end, I’m mainly glad that I got pretty permalinks to work.  :)

Sources/Credits:
http://codex.wordpress.org/Using_Permalinks
http://einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/
http://ikailo.com/94/url-modrewrite-workaround-iis-60/
http://www.keyboardface.com/archives/2007/09/07/update-for-wordpress-permalinks-on-iis/

Site Redesign

Hey folks! Thanks for stopping by.   :)

If you’re here because of my LEGO MINDSTORMS NXT tutorials (on YouTube), then click the link for more information.

For the rest of you, I’ve overhauled the site and would like to start adding more content as time goes on. In the mean time, you can check out my e-portfolio (created as a college assignment… to organize college assignments). For now, it will remain as a stand-alone sub-site until I figure out what to do with it.

Chad