Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

[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.

  • 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 :-)

share|improve this question
add comment

3 Answers

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

share|improve this answer
    
This is not the same problem I'm having.%postname% resolves fine, but not if it's in the beginning of the permalink. And, I'm running Linux, not Windows. –  Patrik Alienus Sep 12 '13 at 16:13
add comment

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
share|improve this answer
    
I have yet to receive word back from the hoster about this possible solution, however I've discovered that it's not about whether it contains %postname% or not, but rather if it begins with /static_text. I.e. it works fine with /archive/%postname%/ but not with just /%postname%/. Does this change your idea, or give you other ideas? :-) –  Patrik Alienus Sep 4 '13 at 18:29
    
I've checked now, and the server apparently has "OPTIONS Indexes Includes -FollowSymLinks +SymLinksIfOwnerMatch". I'm gonna see if I can have them change it to your suggestion. –  Patrik Alienus Sep 6 '13 at 10:13
add comment
up vote 0 down vote accepted

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?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.