|
Posted on
12.14.07 by Widge @ 1:12 am
Okay, so here's some fun. Make yourself comfortable. I went out to find an image for Needcoffee from the archives we've already got on the site so I wouldn't have to grab it from elsewhere (remember, kids: recycle!) and realized that some of our archival pages weren't loading properly on the new server. Brief explanation: on Version 3 of the site (pre-Wordpress) we used frames. We're not proud of it, but it made sense for 1998. The content portion of the site was an .htm file. The frame that went around it and contained the masthead and the menu/sidebar was an .html file. So you could have, for example, a DVD review of Drop Dead Fred and the review itself was ddfred.htm while the frame that held it was ddfred.html. Again, it was the best we could muster at the time. Anyway, while checking out the new server for this old image I wanted, I discovered that the .html versions of pages were coughing up a lung. "An error occurred while processing this directive." Lovely. But the .htm versions were fine. What to do? Well, tear open a .html file and saw that AXS, the web tracking bit we used to use on the old site (and still use in the archives) wasn't working because it was pointing to an old CGI directory and the CGI directory wasn't kosher any longer. So the first thing I tried to do was get the old CGI directory to work, but I couldn't seem to figure out how to do that. And I wanted to get the damn thinking working. So I decided, hey! Screw it, I'll just to a rewrite via the .htaccess and when people go to the .html version, I'll just send them to the direct review instead. That's actually better from an SEO perspective because back when we setup the whole framed system SEO wasn't even a twinkle in anybody's pants. But somehow I botched it and the .htaccess blew up the site for a few minutes. I had a Redirect that never redirected anywhere, and it didn't matter that it was in my /html/dvd/ directory, the server read down through .htaccess, couldn't go any further and barfed. Why did this happen, children? Because Uncle Widge fucked himself over. He got in a hurry and forgot the cardinal rule of screwing around with your site: The Cardinal Rule of Screwing Around With Your Site:That's right. When you forget the Cardinal Rule, Yahweh himself will laugh at you and your site will explode. So. I finally got that corrected after a few minutes outage, and I was able to find some info on how to do this in .htaccess. Not that I think anybody out there has the same setup as the old Needcoffee.com site, but still. You can futz with this to match your own site. This is a variation on what I found at SEOBook, which was the best and closest to what I was trying to do. Disclaimer:So. I basically have an .htaccess in the subdirectory where I want to make this change. I added this to the top:
Here's what I can tell you. The Options and RewriteEngine statement make the thing work to begin with. The rule itself says for every .html hit, rewrite and resend them instead to .htm. Also, it gives a 301 redirect, which is good because search engines need to be able to find the content that's been "moved," or in this case, simply bypassed. The one thing I don't understand is, the way I read this code, it looks like it should only work for the /html/ directory, but it instead works in all subdirectories. So that I'm clueless about. Just for the moment it works. There? Aren't you sorry you asked now? Update: Shade at That's My Stapler tries to help my inept ass out. I think I almost understand what he's saying…I can do coding, me. Taggification: archives, axs, cgi, frames, htaccess, html, images, rewrites, seo Filed under: Fun With SEO
|

John Robinson is a writer of prose, poetry and comics who also writes under
the pseudonym of Widgett Walls.
This is my latest book. Short stories written especially for you, or at least someone who reminded me a lot of you at the time.