Hello,
I’ve been using categories in my main menu and all of them seem to have 404’d recently… no idea why. The theme was a bit behind (2.3) but I updated to 4.5 today and still no luck.
Website:
http://www.xtremerigs.net/
Category pages are still dead when clicking on them via breadcrumbs. If someone could provide some insight onto why this is I’d greatly appreciate it.
Thanks!
Hi guys,
Thank you very much for the suggestion.
@Lucian I played with the permalinks and they seem to be the source of the problem. Currently I’m using the “Day and Name” structure; I changed it to “Default” and all of my menus were fixed, unfortunately changing the structure of course breaks all of the links we’ve posted anywhere over the past year…
I changed it back to “Day and Name” and menus are dead again, but at least the old links all work still. Any suggestions on how to proceed?
Thanks.
Hi,
Please deactivate all plugins, empty cache if you use any cache plugin and also purge files if you use any CDN service, after this change your permalink structure to default and then back to your custom permalink structure.
If this dose not solve it please go trough this: http://codex.wordpress.org/Using_Permalinks#Fixing_Permalink_Problems and this: http://codex.wordpress.org/Using_Permalinks#Using_.22Pretty.22_permalinks and make sure you use the permalinks right.
Thanks
Hi Guys
Just to confirm – Christopher – I checked the log and there were no recent errors.
Lucian – there are no cache plugins so there was nothing to do there nor cdn plugins. It’s not a custom pretty permalink – it’s just the standard “day and name” option so we are hardly going offroad with this.
I did make sure attributes were 666 on .htaccess, and I cleared the file, and it was auto regenerated by WP to be the same as it was before.
The problem is not that the links don’t change – the menu links change depending on the setting in WP e.g. clicking the menu category gives the following link:
Permalink “Default” setting:
http://www.xtremerigs.net/?cat=4
– result = shows page correctly
Permalink “Day and Name” setting:
http://www.xtremerigs.net/category/build-logs/
– result = gives 404 error
Other things from those links – adding to the .htaccess in the public_html dir:
– I tried AllowOverride – but that seemed to stop the site from working – maybe I did this wrong
– I tried FollowSymLinks – no change
Any ideas?
Thanks!
Switch to default twenty-fourteen theme, check to see if issue still there.
Permalinks are not managed by the theme in any way; but by WordPress.
Issue will always be either
a) permalinks not written to the htaccess file – or can’t write to file (it should tell you this in the WP screen when trying to update them) — you might want to look at your .htaccess file to make sure it has everything it’s supposed to from WordPress
B) caching of old permalinks when you try to go to a page containing a link to the old page
c) some kind of “optimization” plugin which is messing with the links — this is VERY common with thing like YOAST SEO where they have option to “remove stop words” and that can cause issues (in my own experience)
d) some “slugs” for file name (“page” or “post”) or categories on certain servers are disallowed for php … I ran into this couple of years back being unable to “write” a certain page no matter what — the URL contained some mix of a word string somehow used by server and could not be parsed.
Did you try changing the slug for your “bad” page ?
Chris
Hi Chris,
It appears to be a WP/Database issue, not a theme issue. 2014 theme still has the same problems.
Here’s what’s in our htaccess file:
# 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
Tried disabling all of the plugins again and had no luck there.
Tried changing the slugs but no luck sadly.
One thing I did forget to mention was previously I had setup a bunch of pages that would have similar URLs to the category (we were debating if we wanted to use a page system or category system with the main menu but decided on categories). Well when the issue first started happening, SOMETIMES, the category links would redirect to the pages…
IE
http://www.extremerigs.net/category/news would redirect to http://www.extremerigs.net/pages/news.
So I tried disabling all of the unused pages to see if that would help. It stopped the random redirecting, keyword here being random and inconsistent, but still 404.
Thanks for your help guys.
Might just work on the site locally and do a clean wipe of the database and go from there…
Hmmm…. likely you could make a new “category” that doesn’t conflict with the page name, then delete old category and redirect to the new category (WP gives you option when deleting category to point at a replacement category, if memory serves — might be a plugin for that I’m thinking of …); then try deleting the page, then create a NEW page.
Likely also running WP-Optimize after doing backup might help, and perhaps using the built-in WP repair dbase function I think you can do by adding a line to your wp-config.php file if memory serves (sorry, been down these roads a few times the past 9 years, but some of it rusty in my fragile little mind …) 🙂