WP Hive » Troubleshooting and How-To

Can't View Pages or Posts

(20 posts)
  • Started 1 year ago by jconrad
  • Latest reply from ikailo
  • 1 Members Subscribed To Topic

Tags:


  1. jconrad
    Member

    Are there other solutions aside from re-saving permalinks? I have tried this numerous times, but I am unable to load any pages or posts. Just get 404 errors...

    Thanks

    Posted 1 year ago #
  2. jconrad
    Member

    I'll only add that I can view all of the homepages and get into the admin pages, I just can't see the pages/posts within the sites.

    Posted 1 year ago #
  3. jconrad
    Member

    It seems like it must have to do with permalinks given that my search functions work and send me to working results pages that do not use friendly permalinks... anyone with any thoughts on how to fix this problem? kind of freaking out here, I have a lot of sites in the hive at this point.

    Posted 1 year ago #
  4. ikailo
    Developer

    Please check that mod-rewite is installed and working. You may need to check with your host.

    When / how did this start happening?

    I'm remote right now (at the cottage) so please send me an email if you still have issues, as it is easier to respond to.

    Posted 1 year ago #
  5. Ronal
    Member

    I just submitted a new topic about this. Seems my .htaccess info has disappeared, even after manually trying to "reset" permalink settings. Now all links on all blogs are broken.

    Posted 1 year ago #
  6. Ronal
    Member

    First request never posted. I can't posts or pages. Any update or suggestions on this? Mod rewrite is installed, I tried "resetting" my permalinks, nothing seems to be working. I downloaded my htaccess file and it's blank. Help please.

    Posted 1 year ago #
  7. I have the same phenomenon here.

    As soon as I update the permalink structure in one of the hive's blogs, everything except homepages and "non-pretty-urls" goes 404.

    Reason? for some reason the .htaccess is not updated, but emptied, it only contains the Wordpress start/end comments.

    So my workaround: use the same permalink structure on all of your hive's blogs.
    First (before activating wp hive) set the permalinks in the original blog. Make a copy of the .htaccess via FTP, the file manager plugin, cpanel, or whatever.
    Activate wp hive, create the blogs you need, edit/save permalinks for each of them and use the same settings for all.
    When done, replace the empty .htaccess with the one you saved. Make it non-writable, just in case...

    Posted 1 year ago #
  8. Michael143
    Member

    We have the same issue jconrad. I'll follow ikailo's solution for this. I find it hard to fix it. I'll try it later. Hope it'll be okay.

    Thanks a lot for information ikailo.

    [url=http://www.fatlossblogger.com/]P90X Workout[/url]

    Posted 1 year ago #
  9. Same i encounter the same problem..

    Posted 1 year ago #
  10. Any updates from this

    Some tips for a dog trainer: weimaraner obedience and weimaraner puppy training.

    Posted 1 year ago #
  11. superscott597
    Member

    @ShamanMa Thanks for pinpointing the problem! That's exactly what it's doing. I was having the same problem as jconrad and using the rewrite code from a working .htaccess file fixed all my sites instantaneously. Hopefully this bug will be addressed soon, as it can be a pain to have to copy it every time or wait to test the sites until all have been installed and set up.

    For those that don't know quite what the .htaccess should look like, here is what mine uses to display the pretty permalinks:

    # 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

    Cheers!

    -Scott

    Posted 1 year ago #
  12. wwday3
    Member

    Same issue. Same (annoying) solution. Why would WP remove an existing set of .htaccess code? Does it have something to do with the multi-site feature in the new release?

    Right now it means for each new hive blog we add, we have to remember to update the .htaccess file or all blogs will suddenly not work. Very annoying.

    Posted 1 year ago #
  13. wwday3
    Member

    Bump. This is a major issue.

    Posted 1 year ago #
  14. ikailo
    Developer

    It is for this reason that it is recommended to make .htaccess read-only after it contains the correct information.

    If you are running subdirectory sites (domain.com/blog1) then this is what .htaccess should look like:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    If you're not using subdirectory sites (domains or subdomains only), you can use the rewrite rules posted by superscott597 above.

    .htaccess rarely needs to change, so once it is written, make it read-only, and you should not have this problem anymore.

    Posted 1 year ago #
  15. wwday3
    Member

    That's not the point. I tested this out with a "normal" WP site. Clicking update in the Permalinks panel did not "clear" the .htaccess file. Why, in a WP-Hive environment, does it get cleared? That is not normal behavior for a WP install.

    BTW, the only time I've heard anyone suggest making .htaccess read-only was in regards to anti-hacking strategies.

    Posted 1 year ago #
  16. ikailo
    Developer

    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: (domain.com?p=n), 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 (domain.com or blog.domain.com), then it will generate correct code. If it is generated from a subdirectory site (domain.com/blog), 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.

    Posted 1 year ago #
  17. wwday3
    Member

    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.

    Posted 1 year ago #
  18. wwday3
    Member

    So, what should the permissions be? 555?

    Posted 1 year ago #
  19. wwday3
    Member

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

    Posted 1 year ago #
  20. ikailo
    Developer

    I would suggest 555.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.