PSA to those getting 404 errors when uploading image
-
I ran into an issue where uploading an image larger than ~50kb resulted in wp-comments-post.php returning a 404 error. This had nothing to do with the plugin itself as it worked fine in a local testing environment. Rather, it appears my webhost (HostGator) has some odd security rules tied specifically to wp-comments-post.php. (The maximum upload size is set to 64 MB and had nothing to do with the problem.)
So if you are getting 404 errors after uploading an image through Comment Attachment, here are a couple solutions:
1. Try a different web host or a local environment using DesktopServer.
2. Make a copy of wp-comments-post.php and name it blahblah.php. Then, when calling the comment form in your theme, specify it to use the new file like this:
comment_form(array('action' => '/blahblah.php'));
Yes, merely renaming the file fixed the 404 issue for me.
- The topic ‘PSA to those getting 404 errors when uploading image’ is closed to new replies.