WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Permalink hacks? (5 posts)

  1. ZachA
    Member
    Posted 7 years ago #

    I'd really like to be able to use something other than the standard /?p=123 permalink structure, but at my host (which is otherwise very flexible) I can't allow WordPress to write to the .htaccess file. Is there any workaround that anyone knows of?

    I believe I can probably strip the ?p= part via a rewrite rule (not looking forward to figuring that out! :0) which would be an improvement.

    However, the following possible (and possibly crazy) hack occurred to me today -- does anyone see any major drawbacks I'm missing? It goes like this:

    • Instead of hitting the "write" button, post by going to /wp-admin/post.php?action=edit&post=YYYYMMDD, where "YYYYMMDD" is that day's date.
    • Via a rewrite rule, turn the permalinks from /?p=YYYYMMDD to /YYYY/MM/DD.
    • Via rewrite rules, redirect /YYYY and /YYYY/MM to archive pages of some kind if possible.

    Posts will still be in the right sequential order, but by "date" instead of number.

    One drawback is it assumes no more than one post per day, but for this blog I don't plan on doing that anyway.

  2. Chris_K
    Member
    Posted 7 years ago #

    Have you looked over the Permalinks page?

    Why not "almost pretty" permalinks? Why make the default ones even uglier?

    If your .htaccess is made read-only, when you visit Options -> Permalinks (and scroll down) WordPress will tell you what to manually add to the .htaccess.

  3. ZachA
    Member
    Posted 7 years ago #

    Yes, and I find it confusing :)

    I have finally gotten the "almost pretty" ones to work (though I'm not sure why you think they're prettier than what I was suggesting, which would've been /2007/08/28 without index.php), and may end up doing that.

    But I'd really like to get the normal ones working. Even with the code in .htaccess manually, it still doesn't work -- it returns 404's for all the links.

  4. Chris_K
    Member
    Posted 7 years ago #

    And 2 hours later I finally got my head wrapped around your original idea.

    I'm way too much of a rewrite rules dummy to help with that tough. :-\

  5. ZachA
    Member
    Posted 7 years ago #

    Yes, wasn't it a crazy one? :-O

    I actually think I may have finally figured out the problem, which may be specific to my host. They have AllowOverride set to "none" (it's taken me months to figure out that was the relevant piece of information and what it meant), and the procedure for working around that has eluded me until now...

    Thanks for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic