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.

I have 40+ posts on my blog. Only one of them is going to a 404 page when I click the title (visit the permalink).

To see it in action: http://thegrovestead.com/tag/strawberries/

Look for the post "Cure for the common slug" and click the title (permalink: http://thegrovestead.com/cure-for-the-common-slug/)

You will get the 404 error. Note that all the other posts on that page will display the single post fine.

My htaccess is clean:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

I've disabled all the plugins. I've tried deleting and recreating the post, still getting the 404 error. If I modify the slug by one letter, it works. But the specific permalink above does not work.

There must be an explanation. Any advice?

share|improve this question
    
it's strange indeed. you can try adding var_dump($wp_query); to your 404 template to get a clue as to why it's not finding the post, this will show you the SQL query being sent to the database and may provide a hint. also make sure the trash is empty for posts and pages, that's a long shot though. –  Milo Jun 28 at 4:32

1 Answer 1

It is not listed in the Codex but perhaps the word 'slug' in the pages URL is a reserved word? Just a wild guess and could be completely wrong. I thought it may be worth mentioning however as others may encounter a similar problem and might be the result of using reserved words.

If you reference the link to the WordPress Codex listed below, it states when using a reserved word in WordPres: "Doing so can cause WordPress to respond with a 404 error without any other hint or explanation."

For a complete list on words to avoid you can find these on the WordPress Codex. I believe this list is not 100% complete and there are a few other words but these are the bulk of them.

share|improve this answer
    
That's just for get or post var names, there are no reserved words in slugs. –  Milo Jun 28 at 13:35
    
Thanks @Milo, didn't realize that :-) –  Matt Royal Jun 28 at 13:51
1  
There is one thing to look out for with slugs though - if you create one that's just a 4 digit number, it'll get picked up by the year rewrite rule and WordPress will try to load a year post archive. –  Milo Jun 28 at 15:30
    
Its not the word 'slug'. I tried several variations all with the word slug in them, and it works. Only the exact url above causes the error. There are no posts in the trash to delete, but its possible something is stuck in the database. For now, I have removed the 'the' from the slug and it works fine: thegrovestead.com/cure-for-common-slug Go figure. –  thegrovestead Jun 28 at 22:54

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.