[resolved] Posts don't show ONLY on main page with Permalinks (8 posts)

  1. Nevyn522
    Posted 6 years ago #

    I just switched from a Linux shared hosting plan to a IIS shared hosting plan (leave your hosting complaints at the door, there were other forces at work). I migrated my data over by hand, and have all the posts and administration and accounts all working properly.

    However, permalinks aren't quite so pretty. I followed the advice from here to create a custom 404 page. However, since I'm hosting multiple domains from the same account, I had to modify the solution to point to the right subdirectory. Astonishingly, it worked. I could navigate to any archive, any category, any individual post. (Once I fix it up, I'll give back, I promise.)

    However, my blog home page doesn't display ANY entries. It shows a single link to "Edit this entry," which doesn't actually link to anywhere -- this comes from within the main while() loop, so I know that: it's determining there are posts, it's including the post.php that's also used for other channels, and it's executing the code. However, looking at the source, none of the expected content is there.

    HOWEVER, if I change permalinks from

    The main page works. I'm baffled as to how changing the permalink (especially that slightly) could cause the main page generation loop to fail so catastrophically.

    Does anyone have any suggestions?

  2. Nevyn522
    Posted 6 years ago #

    Turns out that trying to "preview" works -- http://www.office-monkey.com/?preview=1, as does specifying ?height=751&width=1080.

    It appears it only DOESN'T work when I specify:

    Other themes also don't work, so it's not related to that...

    Anyone have any ideas?

  3. Nevyn522
    Posted 6 years ago #

    I've investigated more, and I'm just bewildered. Accessing my home page with permalinks set to:
    it loads and uses theme\index.php

    When I change to
    it loads theme\post.php

    Since there is no corresponding post, the page is blank.

    It appears that my 404 page isn't loaded (I put in logging code, and nothing is logged, but it is when I explicitely go to a bad page). How can I determine why post.php would be loaded for both implicit and explicit blank page, rather than the default index.php for my theme?


  4. RichardM
    Posted 6 years ago #

    Not that it helps that much but I am also experiencing a similar problem hgaving switched over to an IIS server plan. It sounds like that is the problem.

  5. Nevyn522
    Posted 6 years ago #

    I've drilled down to the following, and it appears to only be peripherally involved with whether or not my host supported rewrite rules.

    The incoming $_SERVER['REQUEST_URI'] is the same regardless of what the permalink setting is.

    There are two different settings I'm alternating between. It appears that within WP_Query.parse_query() two different sets of query strings are coming in; I'm trying to walk back up the callstack to find out where it could have changed.

    In the success case:
    permalink: /index.php/%year%/%monthnum%/%day%/%postname%/
    $wp_query->query: '' (empty array)

    In the failure case:
    permalink: /%year%/%monthnum%/%day%/%postname%/
    $wp_query->query: { 'subdomaindirectory/index.php' } (1 element array)

    Now, I imagine this has something to do with the internal processing of the rewrite rules in rewrite.php, but I haven't yet looked into them enough. If someone has an immediate answer as to where I should focus, well, that would be great.

  6. Nevyn522
    Posted 6 years ago #

    HA! Figured it out.

    Will post full explanation and steps tomorrow, as it might be useful to other people. Short version: final, default regex redirects to page-mode. Unfortunately, it also matches legitimate index.php access when located in a subdirectory.

    Have a solution now, working on a better one for the future.

  7. sswx3
    Posted 6 years ago #

    post a fix please or link me to something that works

    thank youu

Topic Closed

This topic has been closed to new replies.

About this Topic