Can't View Pages or Posts

Home Forums Troubleshooting and How-To Can't View Pages or Posts

Tagged: ,

This topic contains 19 replies, has 8 voices, and was last updated by  ikailo 7 years, 6 months ago.

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
  • #1515


    I can see how this sounds strange, but there is a reasonable (technical) reason for it, which I will attempt to explain.

    There are two types of peramlinks changes – Soft and Hard. A soft refresh only makes changes in the database. A hard refresh makes changes to the database and to .htaccess.

    If the permalinks are set to ‘default’ / not pretty: (, then a hard refresh will remove everything from .htaccess and clear the permalink rules from the database. In all other cases, .htaccess is written with some generic rules (as above) and permalink rules, specific to the selected permalink format, are written to the database.

    When .htaccess is generated, it uses the URL of the current site to generate what it thinks is proper code. If it is generated from a root site ( or, then it will generate correct code. If it is generated from a subdirectory site (, then it will generate code that will only work for that subdirectory site if it were standalone.

    WP Hive also tells WordPress to add a few extra rules to .htaccess to allow subdirectory site mapping, which are included when .htaccess is regenerated during a hard refresh.

    WordPress makes a hard refresh to the permalinks in the following circumstances:

    1. When a new site is installed.

    2. When the Permalinks settings page is loaded.

    3. When the Permalinks page is saved

    Surprisingly, there are NO hooks in WordPress to allow a plugin author control over the hard refreshes, so the following actions were taken:

    1. WP Hive overrides the wp_install() method to prevent a flush when a new site is installed.

    2. There is a ticket in Trac to prevent Permalinks from being flushed on the page load.

    3. There is a ticket in Trac to let a plugin tell WordPress to skip the hard refresh.

    Until those patches are included in core, there is nothing WP Hive can do to prevent WordPress from doing a hard flush and changing .htaccess when it’s not needed. So, that is why .htaccess should be set to read-only.

    The only other option would be to regenerate the permalinks from a root site after each time the permalinks page is accessed or permalinks are regenerated on a subdirectory site or a site that has been set to the default / not pretty permalinks.

    I hope this makes sense.



    This must be new, because I’ve set permalinks many times in the past with hive sites and the same .htaccess clearing phenomenon did not occur.



    So, what should the permissions be? 555?



    Still waiting fot your suggested permissions for .htaccess. 444? 555? Something else?



    I would suggest 555.

Viewing 5 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic.