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>
Share:
8,856

Related videos on Youtube

kambi
Author by

kambi

Updated on September 18, 2022

Comments

  • kambi
    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
      Broco over 7 years
      The 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
      kambi over 7 years
      Thank you @Broco, I've added Apache.conf and .htaccess of the theme. adding Options -MultiViews did not help.
  • Broco
    Broco over 7 years
    Just 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.