Why would Numeric permalinks work, but %postname% won’t?

[Question edited as I discovered more]

I have a weird problem, in that my permalinks do not work. Well actually, it works when the permalink-structure is set to something which begins with static text. (/archive/%postname% for instance). This would be fine if the site was only consistent of pages, which still gets their proper name, but it isn’t. All blog entries are thus /archive/<postname> and Press Releases which is a custom post type, becomes /archive/press-releases/<postname> which doesn’t fit my needs.

Read More
  • I know it’s not the theme because it works just fine on both localhost and on another dev-server, which are both exact copies of the soon-to-be live domain (which is why I can’t give out the URL). I no longer am sure it’s not the theme. Can’t for the life of me figure out what it could be. If anyone can think of which piece(s) of code to use for diagnosis, I’ll copy/paste whatever I need to.
  • I know it’s not Plugins either because I’ve tried disabling them all. No luck.
  • I know it’s not the .htaccess because it is also a duplicate of what’s on the other servers, and I even tried removing it completely and had WP re-write it. Also, what I’m getting is the WP 404, not the Apache 404.

Thankful for any ideas on what the problem might be.

Edit:
I have now moved the site to a completely new WP install in a different hosting environment. The problem persists. This simply does not make any sense to me. I now think that something is in fact wrong with the theme, but it still works on localhost and on a separate dev-server. Could it really be that two completely separate hosting environment have the same weird problem?

Edit 2:
I’m no longer expecting a solution, I’m merely adding this info in case someone else has similar problems and want to resurrect the questioning at a later date.

What I’ve done now, is to first enable the default twentythirteen theme and the set the permalink structure to /%category%/%postname%/. I didn’t expect it to work – but it did! I then figured it was the theme I’ve coded. But, not so sure. As I re-enabled the theme I’m going to use and reloaded the page, the permalinks still work!

If I now go and fiddle with the permalinks however, it fails again.

I’ve given up trying to find a reason for this odd behaviour. All the info above is still accurate. If someone wants to enlighten me, please do so 🙂

Edit 3:
I figured out what was wrong. It’s the accepted solution.

Related posts

4 comments

  1. PROBLEM
    I had the same problem on Windows 7 localhost using WAMPServer and Apache 2.2.22. Any permalink structure containing the post name didn’t work. I got an error telling me the page could not be found.

    SOLUTION
    I found that, by default in this installation of Wampserver, the Apache “rewrite_module” is disabled. I enabled it and now my posts and pages work fine.

    HOW TO
    1) With Wampserver running, click the little green icon in your taskbar.
    2) Hover over Apache, then hover over “Apache Modules”
    3) Scroll down the list to find “rewrite_module”
    4) If it is disabled (does NOT have a check mark in front of it), enable it (add a check mark)

    enter image description here

    That’s all I had to do. I didn’t even need to re-start the Apache server. It just started working.

    Alan

  2. Check your Virtual Host configuration. And if you see MultiViews is enabled, like this:

    Options Indexes FollowSymLinks MultiViews
    

    Then remove it and leave it like this:

    Options Indexes FollowSymLinks
    
  3. I have now discovered what the issue was.

    It was a malformed (yet, working!) register_taxonomy function in my functions.php. So, if anyone has this issue, make sure that your custom taxonomies are all properly done. One of mine was not.

    I guess the reason that a malformed taxonomy can create such a strange issue, is because it is related to the permalink structure.

    Perhaps this is an issue with WordPress of course – should WordPress really do something this dumb just because a taxonomy is not properly written?

  4. I had the same issue, permalinks were working for a while until I installed a plugin that also used permalinks, at which time my permalinks for my custom post type worked intermittently. And so I found this question and checked into my register_taxonomy function as the asker had mentioned. What I found is that my slug for the custom post type was actually the same as the one in the custom taxonomy. Once I changed the taxonomy to a unique slug, the permalinks worked again.

Comments are closed.