• I’m working on transferring a Movable Type blog into WordPress, and I’d like to keep my permalinks as similar as possible. I’ve read up on how to set up the virtual site structure, which gives me part of what I want, but there’s a crucial missing piece.

    I’ve been using Mark Pilgrim’s “cruft-free slugs” technique for generating permalinks in Movable Type. Basically, if there’s something entered in the KEYWORDS field, it uses that to build the file name in the permalink; if not, then it dirifies the post’s TITLE. I’d like to be able to replicate this in WordPress, but I’ve been unable (as yet) to concoct the right recipe to do so.

    I’d also like to be able to dirify with underscores rather than hyphens, but I imagine that’s an easier hack.

    There are, of course, a number of solutions involving redirects that I could put together, thus avoiding the dreaded linkrot, but those aren’t as elegant, and I’d like to use them only as a last result.

    —Okay, so I poked about a little before posting, and it appears I could cook up something with the SLUG field? Maybe by editing the raw data to stick the KEYWORD or TITLE entry into SLUG and then importing, thus skipping the whole need for an IF/THEN thingie… Anyway. If anybody’s solved this particular import problem, and has a quick and easy hack (because we do like quick and easy), it would be much appreciated. Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • I had the importer I wrote for Mark earlier, please be patient while I search.

    It’s here:
    https://2fargon.com/import-mtfiles/import-mt-markp2.phps

    Mark told me this worked for him, should you have any problem, email me at carthik at google’s mail website.

    Thread Starter kipmanley

    (@kipmanley)

    It might not happen today, but I’ll be sure to let you know. Thanks so much!

    Thread Starter kipmanley

    (@kipmanley)

    Perhaps I’m missing something…

    If I run the file, all I get is a page saying, “No input file specified.” Both import-mt-markp2.phps and import-mt.php have been edited to point to my MT export file, as per instructions.

    Hmm. Poking around a little, I see that this might have something to do with running PHP CGI. I’m hosted with Dreamhost, who do use that, though you can turn it off. But I haven’t had a problem yet with making test posts and running other little WordPress php thingies, and if I do turn PHP CGI off, it appears to totally munge up WordPress and I have to reinstall it. —Also, it appears this “No input file specified” might instead have something to do with .htaccess. Or maybe permissions. Ack! Has anyone else run into this problem and solved it?

    Kip, I have no clue why you are getting the error if you specified the location of the txt file containing the MT entries. Must be something simple that misses your eye.

    “import-mt-markp2.phps OR “import-mt-markp2.php”

    There’s a big difference between the two.

    Tg

    Thread Starter kipmanley

    (@kipmanley)

    Thanks, TechGnome. That did throw me at first, but I figured it out.

    2fargon, I dunno what’s up. It’s obviously not a problem with your script: it has something to do with either .htaccess, or the PHP CGI that Dreamhost uses, or some combination of them that’s beyond me. Dreamhost themselves weren’t terribly helpful, and I haven’t found anything that suggests an answer. I may give up on replicating the old titling system anyway, and write redirects, much as that galls me.

    But thanks! If anything does turn up, I’ll post it here.

    Cool. We’d like to help in whatever way we can, is all.

    Thread Starter kipmanley

    (@kipmanley)

    Okay! On the one hand, I got it to run.

    I went to the Domain panel of my Dreamhost setup and edited it, flipping the switch to turn off “Run PHP as CGI.” It takes a minute for this to take effect. You can tell it’s happened because when you try to run a WordPress page, it gives you fatal errors.

    Then I deleted my WordPress directory, though I left my database in place, and re-loaded WordPress. Because I’d left the database in place, I didn’t have to re-install it. Then I made sure import-mt-markp2.php and my import file were in place, and I ran import-mt-markp2.php. Success! No more “No input file specified” error!

    However, it doesn’t appear to do anything.

    It loads all my entries just fine, but the slug is set to the standard WP format: hyphens, not underscores, and based on the title, not the keywords.

    I assumed at first it was because I had virtual site permalinks set (to match the eventual MT pattern), and this was maybe overwriting what import-mt-markp2.php was trying to do, and so I turned it off. I emptied out the database, re-installed WP, and re-ran import-mt-markp2.php. But again, it didn’t do anything: the slug still ignores any entries in keywords, and dirifies it according to WP style, not MT style.

    But at least I got it to run. Hmm.

    (It also appears to have deleted all my trackback pings. Hmm again.)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Mark Pilgrim’s slugs–’ is closed to new replies.