[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 🙂
Edit 3:
I figured out what was wrong. It’s the accepted solution.