Getting 'File Not Found' on Wordpress Page
8,856
Chaning .htaccess inside Wordpress to this solved the problem
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Related videos on Youtube
Author by
kambi
Updated on September 18, 2022Comments
-
kambi over 1 year
I created a new Wordpress page, I can't access it in the browser and my Apache error log shows:
File does not exist: /var/www/website/wordpress/new-page, referer: http://new.comelody.com/wp-admin/post.php?post=315&action=edit
Here is Aapche.conf
<VirtualHost *:80> ServerName new.comelody.com DocumentRoot /var/www/website/wordpress RewriteEngine On <Directory /var/www/website/wordpress> AllowOverride all Options -MultiViews </Directory> </VirtualHost>
and this is .htaccess inside the theme:
<IfModule mod_rewrite.c> RewriteEngine on #RewriteBase /test RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d </IfModule>
What is the cause of this?
Thank you!
-
Broco over 7 yearsThe cause of this is that the file does not exist. Jokes aside, the first step is to look for the file that doesn't exist according to the error. My bet is that either the file is missing or its name isn't "new-page" but "new-page.php" and you have neither MultiViews or Rewrite active. Providing more info often helps.
-
kambi over 7 yearsThank you @Broco, I've added Apache.conf and .htaccess of the theme. adding Options -MultiViews did not help.
-
-
Broco over 7 yearsJust as info, in your apache.conf you disabled MultiViews. Also you have to enable it with the "All" switch to enable your desired behavior. That being said, rewrite as you did it is the safer and therefore better option.