404 after save or publish a post
I am having the same problem, It does this about 75% of the time. The other 25% of the time it works fine. I can’t figure it out because if I try something and then it works for a while and I think it is fixed, then right back to not working again. I thought reuploading the wp-admin folder had done it, but I just tried it and it gave me the 404.
If you come up with anything please let me know.
1. Ensure that you have run /wp-admin/upgrade.php.
2. Check that the “WordPress address (URI)” and “Blog address (URI)” is correct in Options > General (no trailing slash).
3. Try removing http://rpc.pingomatic.com/ from the “Update Services” list in Options > Writing.
Thanks for your suggestions. I have tried all of that before posting this topic. The problem still remains….
ok here’s the deal, i was going to post about this a few mins. ago and i saw this thread at the top!. i’ve been going mad for the last 2 hours trying to understand with my limited knowledge of php.. 🙂
this is what i understood after some tries.. it seems wordpress limits the post to 1000 characters.. before that it saves and previews normally, but when i add the rest of the post, it gives a 404 error saying sorry the page you requested is not found.. after this i went back and manually added more characters until the point , where it doesn’t save the point, did a word count and it came surprisingly as 999 (with spaces).. I then settled to find more on this, but couldn’t.. maybe there are some people who knows if this is a bug, or a feature that can be deactivated somewhere. this happens on previous posts as well, i had this error when i was manually updating some old posts too.. please help soon, since i can’t post anything like this..
ermm, and the interesting thing is there have been many posts that have more than 1000 characters on my blog .. so it makes the problem more complex..
well, can any developer or any experienced user elaborate?
i’m getting the same msg on another blog now, i’ve told a php savvy person and he’s going mad as well.. now the 1000 character thing is not true, i’ve gone over it debunking myself.. 🙂
the other blog gives the same error when saving theme files now.. when i type this is a test, it saves, when i type what i really should type it gives a 404 ..
or this post i was talking about above. It’s there as a draft, I can preview it, I can add other random stuff like asdasda to it, I can add the same sentence over and over and it saves normally, whenever I try to write a rational sentence it gives a 404, this is by far the most creepy error i get from any software, as if the soul of the machine is watching what i type..
btw the thing im trying to type has no strange characters, or code in it.. and what’s more i can type it after those stupid stuff i write and it saves it again, i remove them and it gives a 404, i’m really baffled.. it seems random and i feel like a caveman trying to understand life.. ticking every random thing i find and trying to solve this puzzle.. and our gods have left us.. 🙁
I’m wondering if this issue is a problem with using a different version of mysql, php, or apache.
I don’t get this issue on my local machine, but do on my production server. My production server is RHEL, my local machine is Ubuntu.
The production server is running:
The local machine is running:
The local machine is running Ubuntu breezy. I don’t know how to figure out what version of RHEL the product server is running.
Actually, my problem isn’t that I got a 404. My problem is that hitting “Publish” or “Save” would take forever then send me to a blank page. It’s similar, but not exactly what the originall poster described.
However, my hosting company actually updated their servers last night, and the problem has vanished! Making me believe it was an issue with different versions of software on the server.
New versions on the server:
Apache: 1.3.34 (Unix)
My guess is it was moving the MySQL server from 4.0 to 4.1. Maybe WordPress 2.0 doesn’t play with MySQL 4.0 very well?
They moved the files and everything themselves, I didn’t play with anything.
I am having this same problem since I upgraded to 2.0.1, no matter what the length of the post is. The actual URL it tries to go to after I publish is
I am using Dreamhost, should I switch it using PHP 5?
In answer to my own question, I just tried changing my web hosting account to run PHP version 5, and the problem seems to have gone away. I’ll post again if it returns…
I spoke too soon. I just saved a post without publishing and I got the same error! I am now reconsidering whether this was length-related…
Any clues are welcome.
Has anyone gotten any further with this? At the moment, I have several larger posts that I can’t get into my blog. It may not be exactly 1000 chars, but it does seem size related. And it isn’t consistent. Any Progress?
For what it’s worth, I had a particular post that was being stubborn and giving me the 404 error each time I saved it, and was able to glean a little info from seeding the ‘post.php’ file with a few ‘error_log’ statements and seeing what popped up in the php error log.
The problem seems to result from the ‘$location’ for redirection in post.php being set incorrectly (duh). In this case, the path being taken through the post.php file went through the ‘editpost’ action/case, and $location was set by the
elseif (isset($_POST['referredby']) && $_POST['referredby'] != $_SERVER['HTTP_REFERER'])
$location = $_POST['referredby'];
lines in that case (line 113-114). The location was NOT then altered by the following if statement and get_permalink () call.
You can’t tell this from the resulting address in the browser after the failure, but the entire $location seems to be set to:
<div id='error'> <p class='wpdberror'><strong>WordPress database error:</strong> [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY post_id, meta_key' at line 1] <code>SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN() ORDER BY post_id, meta_key</code>
That’s the only info I’ve gotten so far – it would seem that the problem, at least in this case, was tied to that line of
$location = $_POST['referredby']on line 114 of post.php.
At least that’s what my simple debug would indicate. I’m not sure where that error info comes from, or if ‘referredby’ just happens to be garbage at that point. Maybe that info from the incorrect $location will ring a bell with somebody.
The problem also appears to be related to the ‘save and continue editing’ feature. Start a new post – halfway through, hit ‘save and continue editing’. That returns you to the post. Finish the post – hit ‘save’. Bang – 404.
Maybe that’s why some of you are seeing it with ‘longer’ posts – do you use ‘save and continue editing’?? I use it a lot, just out of a paranoid habit.
More digging required…
More follow-up – all info here applies to my case, YMMV. The page sent back to the browser after I do a ‘save-and-continue-editing’ operation already has the ‘referredby’ field for the submit button screwed up with the database warning string.
If you are one of the folks seeing this 404 issue – try it: start the browser fresh, and go to the ‘write’ page. Start typing a new post, then hit ‘save and continue editing’. When the edit page refreshes, do a ‘view source’ in your browser. Look for the “input name=referredby”, and take a look at what’s in the ‘value’ field. That’s the error string that is then getting sent in the ‘referredby’ field on the next save or publish operation, and causing the 404 error.
Now we just need to find out why that string is there…
- The topic ‘404 after save or publish a post’ is closed to new replies.