• 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 7 replies - 16 through 22 (of 22 total)
  • Thread Starter Lappert

    (@lappert)

    ok, reinstalled phpmyadmin

    My database
    WP_options
    Option ID 28

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

    I didn’t change anything.

    So the permalink is fine in the db as it should be. Still can’t see a solution, yet.

    Thread Starter Lappert

    (@lappert)

    And as I cycle among the permalink options under Settings, the DB in phpMyAdmin also updates.

    But remember the problem is that whatever option is chosen (other than ‘plain’), it results in a 404 Not Found for the post or page.

    I can’t believe the WP developers never dealt with this – or fixed it. A Google search reveals hundred of reported similar problems.

    OK, it’s late and I need to grab some sleep. Will pick it up tomorrow. Thank you.

    You’re welcome.
    But just fyi, all the sites I build, including my own two (one main & one subdomain), have /%postname%/, and I have had no trouble whatsoever.
    I think that you should contact your host’s techs and see what they say.

    Thread Starter Lappert

    (@lappert)

    I wanted to get back to this thread. I was able to find a solution, although not in the approach we’ve discussed.

    It actually was rather simple. This applies to Debian (I’m running Jessie but it should probably work for wheezy) and for those who are using Apache 2 webserver. For other webservers, I can’t say this will work, but one should figure out how to apply it in your cases.

    Although we own and run our own server, we have access to upstream techs. They looked at it and suggested we change

      Allowoverride None

    to

      Allowoverride All

    in the virtual server configuration.

    In Apache 2, that would be in the .conf file for each virtual domain in the Sites-Available directory:

    /etc/Apache2/sites-available/mydomain.conf

    In that file I changed it twice:

    <Directory />
    Options FollowSymLinks
    AllowOverride All
    </Directory>

    <Directory /home/mydomain/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Require all granted
    </Directory>

    Once the change is made, apache needs to be restarted.

    It seems this is necessary as Permalinks rewrites the .htaccess file each time a change is made. So the changes need to be able to override the original settings.

    If your permalinks is not going to change, it might be possible to put the contents of the .htaccess file into the mydomain.conf file and avoid the performance hit. However, I haven’t tried that.

    Enabling mod_rewrite resolved the issue for me on my development server:
    a2enmod rewrite
    Then restarting apache
    service apache2 restart

    rajeshn

    (@rajeshn)

    I am facing the same 404 page not found issue on every link. My front page which is a place, where all my blog posts are posted is seen normally. Clicking on the links on the front page or on the menu results in the error 404 message.
    My site had been hacked and I had then involved WordFence to clean it up, who loaded the clean files on to the server. At that time, I had lost access to the backend, that has now been restored. The pages and posts are there and editable, but don’t show up.
    My hosting provider is Aabaco Small business (the erstwhile Yahoo Small Business) who don’t allow you to upload .htaccess files.
    My site is https://childsurgeon.com/blog/
    Please do suggest workarounds (if technical, I will appreciate a link of some sort).
    Thanks

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