stutley
Member
Posted 2 years ago #
I have an odd problem with 404 and .htaccess.
This is the contents of my .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
ErrorDocument 401 /phillip/index.php?error=404
ErrorDocument 403 /phillip/index.php?error=404
ErrorDocument 404 /phillip/index.php?error=404
ErrorDocument 500 /phillip/index.php?error=404
# END WordPress
Everytime I try to reach a non-existing folder or file in the phillip-subdomain (where wordpress and .htaccess is installed) I get this:
Not Found
The requested URL /php-bin/index.php was not found on this server.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Any ideas?
mikeleeorg
Member
Posted 2 years ago #
I don't have an answer yet, but I've been trying to debug the same problem. I've been documenting my steps at this thread.
It should go like this:
If you have a 404.php file in your themes directory, WP should use that. If not it should use the default 404.php.
I'm not an expert on rewrite rules, but I don't use the additional rules for the error documents.
You might try this:
o Create an empty .htaccess file in your blog directory.
o Make sure it is writable by the web server.
o Go to your admin page Options/Permalinks and check that your permalink structure is the one you prefer.
o Click "Update permalinks", and WP should write the rewrite rules it needs.
After that I hope WP will use your themes 404.php.
If it didn't work, you have the backup of your .htaccess file handy. ( above at least ;)
stutley
Member
Posted 2 years ago #
Thank you very much for the replies. I actually found out that my hosting company somehow has disabled .php errorpages (?!). They offered me a workaround, but the easiest thing to do was to use html-files as errordocuments.
mikeleeorg
Member
Posted 2 years ago #
Just in case this helps someone here, the cause of this problem for me was using FastCGI. A fix has been documented here.