Daily Archives: July 14, 2007

Link-Fixing

Here’s my progress report on my to-do list for the weekend. We’ll go in reverse order.

#4 – Make blog 20% prettier

Haven’t started yet.

#3 – Write About page

Done. You can read the about page if you want. I didn’t give it much thought, but it turned out okay. I’m happy with it for now.

#2 – Update blogroll (from default WP links)

Done. I just went to my bookmarks and then added links to the blogs I visit the most. I also added links to my Myspace page and The Chalkboard Manifesto.

#1 – Fix blog archive links

Done. This took me several hours. (I was also watching TV at the same time. I finally watched Office Space.)

The problem was that URLs which looked like this http://www.agnoiology.com/2006/06/ weren’t working. The individual and daily entries were working, but the monthly pages weren’t. The monthly pages would open up my old MT monthly archives. When I tried deleting those index.html files, I’d get a file listing.

First thing I tried to mess around with was the MT templates. I used the individual entry template from Alex King’s solution for redirecting MT to WordPress (very good, highly recommend using it if you wish to make the same switch I did). Well, first, I had to decipher the damn thing and look up a few PHP commands. Eventually, I figured that this was a dead-end and I did nothing.

Second, I fixed it so I wasn’t getting the file listing anymore. But all that did was give me a 403 Error instead of a file listing.

So I tried a plain old redirect using .htaccess. I had to go into WordPress and go back to the old URL system to find that it was using /m?=200606 for example. I made index.html go to this. It worked, but now I was getting that ugly URL. I didn’t want that showing up because it would confuse people and because it was, well, ugly.

Next, I used mod_rewrite for the redirect. It took me a while to figure out what was even going on with mod_rewrite — it’s damn complicated, especially when one does not even know regular expressions. But I didn’t need the regular expressions. Eventually, I surfed google results for a while and found a simpler intro. I experimented with it and finally got the redirect to work. Mission accomplished.

Well, “mission accomplished” in the Bushian sense. I fixed that but broke everything else. Now the individual entries were giving me 404 errors. Argh!

Maybe the .htaccess files in the subdirectories were giving me problems. I tried putting the mod_rewrite WordPress code in the yearly and monthly subdirectories. No dice.

Okay, might the .htaccess file in the yearly directories be giving me trouble anyway? I mean, I had put those in there to allow HTML files to be treated as PHP files. (This has to do with the solution I used to redirect from MT to WordPress.) I deleted that, but no dice again. I put it back. That wasn’t giving me the problem.

I then thought that maybe WordPress was giving me the wrong code to put in my .htaccess file for those more friendly links. I temporarily changed the access to allow WordPress to write directly to the .htaccess file. Uh oh. 500 Server Error. Everything in WordPress was crashing. I manually uploaded the .htaccess file again and everything was well in the universe. That is, everything except my original problem.

Finally, I looked at the WordPress help file for permalinks a bit and something caught my eye about using a 404 redirect. I didn’t even read it through, but I experiment and I actually used 403 ErrorDocument to redirect things back to WordPress. Now the URL looks pretty and it goes where I want. Problem solved.

It wasn’t the most elegant solution. I had to go through and manually upload .htaccess files to all the monthly subdirectories and then delete all the index.html files. But I’m used to that mind-numbing repetitive stuff from work, so I bucked up and just did it. All done. Hooray.

Option three

I found this comment interesting:

Good note, and criticism of Peggy — who was too enthusiastic when enthusiastic, and is too negative now she’s negative.

Bush is a pro-life, pro-tax cuts, pro-gov’t spending, pro-amnesty, pro-Democracy in Iraq (and the ME) … positive president. He’s right on life, taxes and Democracy, wrong on spending and amnesty.

But he’s always pretty positive. And has reason to be, as does the country, although not the journalists.

Both Bush, and perhaps Peggy, should be making jokes about the low low low unemployment, low inflation (small misery index), decreasing budget deficit…
and steady progress in Iraq.

All we have to do in Iraq is continue being willing to fight, and we will certainly win.
Maybe in 10 years. Maybe in 40 years.

Keep fighting …
or lose.
Those are OUR two choices, and also the bad guys.

But, as the Iraqi people get more experience with us and with them, and realize they DO have a choice, more are deciding to take the responsibility to fight against terror.

Noonan feels Iraq is lost, she is wrong. We are, slowly, winning.

Dan, you keep doing fine, and this was another good one. (and I love Peggy…)

[emphasis added]

There is a possible third option: fight and lose.