• I’m running WP 4.4.1 on a site we’re developing.

    I have the same problem that many others have had. Once I publish a page (or even a post), it becomes not found – AKA 404. I’ve done considerable research on this via Google, so I think I’ve looked at the usual suspected issues.

    It seems many have had this issue for over ten years and it’s still not solved.

    Here’s what I’ve done:
    – deactivated all plugins
    – used a standard theme, 2011 or 2016
    – tried a different browser and even a different computer
    – cleared the cache and cookies on my browser (Chrome)
    – looked at the .htaccess file (see below)
    – reset permalinks as many have instructed
    – examine Apache log files

    The .htaccess file contains:

    `# BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress`

    The .htaccess file is located at /home/mydomain/public_html/.htaccess (the same directory as the WP install). The owner-group is www-data:www-data with 644 permissions.

    The install is running on our own server, running Debian Jessie and Apache/MySQL.

    The error I’m getting is:

    Not Found
    The requested URL /directory/post-name/ was not found on this server.
    Apache/2.4.10 (Debian) Server at mydomain.com Port 80

    I checked the Apache access and error log files and see nothing that indicates the nature of the problem. The log suggests that the post or page was actually seen.

    On the permalinks, I first went back to the plain permalinks
    https://mydomain.com/?p=123.
    Saved that and then I could view all the pages.

    Then I went back to the post-name permalinks, saved that and reset the slugs on each page. At that point I was not able to view the pages.

    At one point I erased Hello World, but I replaced that with another placeholder post, and set up a static front page.

    I have a good number of plugins, but I tested the system with all plugins deactivated, so I don’t think that’s an issue. Would it help to delete them as well?

    So this is driving me crazy and taking up too much time.

    Please, someone, I hope you have a solution. Thank you.

Viewing 15 replies - 1 through 15 (of 22 total)
  • …set up a static front page

    Do you have one page named “Home” (which has “Default Page Template” selected) and another named “Blog” (which is totally blank)?

    In Settings > Reading, this is selected “A static page (select below)” – correct?
    Does “Front page:” have “Home” selected and does “Posts page:” have “Blog” selected?

    Thread Starter Lappert

    (@lappert)

    Thanks for responding, but I don’t think these caused the problem. I set up the static home page after I noticed all the problems.

    When researching solutions, one post said I needed the “Hello World” in order to keep the front page, or a suitable replacement blog post. That’s when I set up the static front page. The page is not “Home” per so, but “MyDomain Home.” There is no “Blog” page, and as far as I know, there is no template for any page. I know nothing about templates. Where would I find them?

    In Settings > Reading, this is selected “A static page (select below)” – correct? Yes, it’s “MyDomain Home”

    For Posts page, nothing is selected.

    But I still can’t see anything about a template. Where would I find that?

    Thread Starter Lappert

    (@lappert)

    OK, I have now done a rest reinstall of the site, starting with a virgin copy of WP 4.4.1.

    I added one plugin: WP Security Audit Log – so I could see any changes and note when the ‘404 File Not Found’ started to happen.

    Looking at Permalinks and making a change, the log reports:

    Changed the WordPress permalinks from /index.php/%year%/%monthnum%/%day%/%postname%/ to /%postname%/

    It is at this point when I try to view the one post, Hello World, it becomes Not Found.

    I did nothing else to the virgin install, just as reported above.

    So it’s pretty clear that Permalinks is the problem. When I try to set Permalinks back to the initial setting, I still get:

    Not Found
    The requested URL /2016/01/28/hello-world/ was not found on this server.

    Do you have an .htaccess file in with your WordPress installation?

    Thread Starter Lappert

    (@lappert)

    Thanks for your reply.

    Yes there is a .htaccess file. See my original post above for the contents.

    Yes there is a .htaccess file. See my original post above for the contents.

    Sorry… forgot.
    If this is live, can you post a link to your site, please?

    Thread Starter Lappert

    (@lappert)

    https://tenantnet.net/

    But this is the new virgin install from this morning. The only thing on it is the Hello World post.

    As you will see, the post at https://tenantnet.net/hello-world/
    leads to a 404.

    When installed, the permalinks are set to Month and Name, and posts may be viewed. But when changed to Post-name, they become unviewable. The only was to get out of that is to set the default/plain to “?p=123” and so on.

    In the Dashboard, in Settings > General, are the “WordPress Address (URL)” and the “Site Address (URL)” exactly the same?

    And who is your host?

    Thread Starter Lappert

    (@lappert)

    Yes, it is the same URL for both.

    We are our own host … we have our own server, running Debian Jessie with Apache.

    See details at https://tenantnet.net/phpinfo.php

    Thread Starter Lappert

    (@lappert)

    This problem occurs with a new virgin install. No new posts, pages, themes or plugins have been added … just what is in the WP download.

    I’ve done a good bit of research on this and there are hundreds of reports of this problem on Google, as well as on Youtube. The purported fix, to set permalinks back to plain, gives you a URL that’s really not acceptable for many.

    To some, setting the URL with month, year and day is OK.

    Trying to get it to work with a preferred URL format of just post name leads to increased frustration — it doesn’t work.

    So with all this, has anyone reported this as a bug to WordPress core, and have there been efforts to address it? Some of the incidents reported go back at least ten years.

    This is frustrating as I gave up installing new sites in Drupal in favor of WP. But this is a fundamental problem.

    Did you added /index.php/ before the permalink structure? Using Permalinks: AllowOverride Not Enabled

    Okay, square one – recap… trying to visualize where we sit.
    I checked your phpinfo and mod_rewrite is installed.
    So…
    1 – In Settings > General: WordPress Address (URL) and Site Address (URL) both set to https://tenantnet.net/ – yes?
    2 – WordPress installation + index.php + wp-config.php + .htaccess all in root – yes?
    3 – .htaccess set to this, with no blank sapces above or below – yes?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    4 – In Setings > Permalinks: set to /%postname%/ – yes?
    5 – Check permalink structure in database >> Login cPanel > phpMyAdmin > (your database) > options > permalink_structure

    Thread Starter Lappert

    (@lappert)

    1. Yes, both WordPress Address (URL) and Site Address (URL):
    both set to https://tenantnet.net

    2. + index.php + wp-config.php + .htaccess all in root?

    Yes, here’s the directory from doc root:

    /home/tenant-new/public_html/wp-admin/
    /home/tenant-new/public_html/wp-content/
    /home/tenant-new/public_html/wp-includes/
    /home/tenant-new/public_html/.htaccess
    /home/tenant-new/public_html/favicon.ico
    /home/tenant-new/public_html/index.php
    /home/tenant-new/public_html/license.txt
    /home/tenant-new/public_html/phpinfo.php
    /home/tenant-new/public_html/readme.html
    /home/tenant-new/public_html/wp-activate.php
    /home/tenant-new/public_html/wp-blog-header.php
    /home/tenant-new/public_html/wp-comments-post.php
    /home/tenant-new/public_html/wp-config-sample.php
    /home/tenant-new/public_html/wp-config.php
    /home/tenant-new/public_html/wp-cron.php
    /home/tenant-new/public_html/wp-links-opml.php
    /home/tenant-new/public_html/wp-load.php
    /home/tenant-new/public_html/wp-login.php
    /home/tenant-new/public_html/wp-mail.php
    /home/tenant-new/public_html/wp-settings.php
    /home/tenant-new/public_html/wp-signup.php
    /home/tenant-new/public_html/wp-trackback.php
    /home/tenant-new/public_html/xmlrpc.php

    3. The contents of .htaccess are generated by WP:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    4. Permalinks – radio button is set at Post name, described as https://tenantnet.net/sample-post/

    However, when that is set, the Custom Structure radio button becomes /%postname%/

    5. I don’t use cPanel. But I do use phpMyAdmin
    But I can’t find “permalink structure”
    There is no table with that name.
    Also in phpMyAdmin I don’t see Options

    (I’m not that well-versed with phpMyAdmin. Are you looking for a specific table, field, ???)

    However, I found https://goo.gl/su0Hmq that describes permalink_structure in the table wp_options. However, I still can’t find permalink_structure.

    I’ll keep looking.

    4. Permalinks – radio button is set at Post name, described as https://tenantnet.net/sample-post/

    However, when that is set, the Custom Structure radio button becomes /%postname%/

    That is what it is supposed to be when https://tenantnet.net/sample-post/ – /%postname%/ will make all the links the same as /sample-post/ – so that is correct.

    5. I don’t use cPanel. But I do use phpMyAdmin
    But I can’t find “permalink structure”
    There is no table with that name.
    Also in phpMyAdmin I don’t see Options

    (I’m not that well-versed with phpMyAdmin. Are you looking for a specific table, field, ???)

    More specifically, the path is: phpMyadmin > “your database” (click on it – it will expand) > your database_options (click “browse” beside it) > permalink_structure. The row will look like this:

    Edit Copy Delete | permalink_structure |/%postname%/ |yes

    Just check to see if it says /%postname%/ – it should. If it doesn’t don’t touch it yet.

    Thread Starter Lappert

    (@lappert)

    Well part of my immediate issue is that I can’t select Browse in phpMyAdmin. When I do I get a red box that says:

    Error in Processing Request
    Error code: 500
    Error text: Internal Server Error

    I’m looking into this. Will be back ??

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘404 Page Not Found after publish’ is closed to new replies.