We gon’ party tonight

I use Akismet to filter out spam comments here, and I’ve seen a few different strategies the spammers employ. There’s the “Cool post! You should Digg it” (in both English and Spanish – tengo que Digg), there’s the “this post helped me on my class project,” there’s the pure jibberish – “xajdjhesbjsb sjhsjhrhjshwru skjskjrijsjs.” But this is a new one I’ve seen over the past couple of weeks:

We gon party tonight
We gon party tonight

Stupid things like this crack me up, not sure why.

Forcing WordPress administration over SSL

I never like typing a password into a non-SSL site, no matter how trivial it is. In order to give my own site this ability I simply used mod_rewrite to force requests to WordPress’s admin pages to go over SSL.

The .htaccess file for the site looks like this:

# BEGIN WordPress

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

# END WordPress

To force the admin pages to SSL, just add these lines under RewriteEngine On:


RewriteCond %{HTTPS} !=on
RewriteRule ^wp-(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Edit – The above code screws up uploads (which go into the /wp-content directory). I replaced that with the following and it Worked As Intended.


RewriteCond %{HTTPS} !=on
RewriteRule ^wp-login(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^wp-admin(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

That’s pretty much it. If your request starts with “wp-” it’ll redirect you to the same URL, but starting with https://. Problem solved. You do need to make sure you have an SSL VirtualHost pointing to your WordPress DocumentRoot so that https://yoursite.com goes to the same place as http://yoursite.com.

Sped up WordPress by adding 1 index.

I noticed WP was taking a long time to load since I moved it. I added an index to the “autoload” column on wp_options and it seems to be much faster.

I still hate MySQL though. Postgres is so much better.

Why is my title in smallcaps now?

WordPress is doing something weird now. Yesterday the head of the site was not in all caps, and today it is.

Hmm.

Ok, I figured it out. I guess I must have installed some new font on this computer – “Trajan Pro” – and the header was showing in that font. I deleted it from the stylesheet and now it defaults to Lucida Sans Unicode, which is what I wanted.