Forums

[resolved] Pages (the non-Post things) are not fetchable (21 posts)

  1. paul
    Member
    Posted 2 years ago #

    So the terminology of this could use some decrypting. Here's the story. I have moved my database/webserver to a new host sometime back. [edit: I have seen some issues with table creation stuff not being done properly, namely autoincrement on IDs having to be fixed on some tables. So I suspect there may be more wrongness in there somewhere.]

    Recently, I wanted to create a new static Page, using the safeInclude plugin. Works fine for me on previous instances. But now for some reason, I can create a Page in the admin UI, edit it, but it can never be displayed. No post with that numeric ID can be fetched. What's the deal here?

    I just changed it from a Post to a Page: still no luck. It's in the database and it looks like any other item (as I look at the other fields in that entry). Is there some meta data that needs to be fiddled with?

  2. paul
    Member
    Posted 2 years ago #

    OK, I created a Post, verified that it worked, then went into the DB and made it a Page. Eventually, the UI sees it (in the Manage Pages area) and it appears on the published site as a Page, but it can't be viewed/fetched.

    Something skwewy going on awound here . . .

  3. moshu
    Member
    Posted 2 years ago #

    went into the DB and made it a Page.
    How did you do that?

  4. paul
    Member
    Posted 2 years ago #

    used a tool to look at the DB (I use CocoaMySQL): changed post_type to page (from post).

  5. moshu
    Member
    Posted 2 years ago #

    Are you sure the post_status hasn't been changed? It should be "publish" for both posts and Pages.

    Also, the other day there was a post here in the forum about the "safeinclude" plugin... as not being safe at all.

  6. paul
    Member
    Posted 2 years ago #

    Are you sure the post_status hasn't been changed? It should be "publish" for both posts and Pages.

    No, it's set as published. The use of safeInclude doesn't seem to have any effect on whether the Page is viewable or not. I can take out the call to the plugin. I still don't see the page (I get

    Its not here anymore !
    The page or post that you are looking for is not found.
    Please try searching through our Archives, or contact the administrators to report the problem.
    )

    Also, the other day there was a post here in the forum about the "safeinclude" plugin... as not being safe at all.

    Well, that's as may be. I'm more concerned with why and how I can make Pages work in 2.2 as they did in 2.0 and 2.1.

    Has anyone addressed the security issues with the developer?

  7. ccoupe
    Member
    Posted 2 years ago #

    Try calling up the page with it's ugly URL. Then check your error log or modify the 404 error template to report more info about the query string/

  8. paul
    Member
    Posted 2 years ago #

    the ugly URL? you mean by ID number? nothing doing there. Pages can't be called that way, apparently.

  9. paul
    Member
    Posted 2 years ago #

    I just dumped my database with create statements and grepped out the insert: I suspect something may have gotten out of whack when I moved it between hosts, moving from 4.something to 5.1.

    [long code moderated - use http://wordpress.pastebin.ca ]

  10. ccoupe
    Member
    Posted 2 years ago #

    if your.site.com/?p=nnn doesn't work where nnn== "the post_id" you changed to "page" status then you've fixed your .htaccess in some strange way.

  11. moshu
    Member
    Posted 2 years ago #

    For Pages it shold be example.com/?page_id=XX
    /?p=YY - works only for posts!

  12. paul
    Member
    Posted 2 years ago #

    excellent, moshu, now we're getting somewhere. That works. I do get the page returned when I use that syntax. Now why doesn't the fancy link work, I wonder?

    I just redid the permalink structure/updated .htaccess. seems to work OK for everything except now NO pages work: I have insert index.php/ before the pagename to get it to load.

    And that one stubborn Page still won't load unless I request it by number.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    
    # END WordPress
  13. moshu
    Member
    Posted 2 years ago #

    No, nothing works when it comes about the permalinks:
    http://paulbeard.org/wordpress/2007/07/09/quote-of-the-day-48/
    You may want to set them to default and verify it they work.

    Further, make sure to ask your host that mode_rewrite and AllowOverride is enabled on your server.

  14. paul
    Member
    Posted 2 years ago #

    OK, I think I have un-broken that. I am my own host, so it was easy to get an answer ;-)

    I know mod_rewrite is on and am pretty sure AllowOverride is good: this all worked, except for one Page, just yesterday, after all. That page still doesn't work unless called by number and now all Pages need to have "index.php" typed in from front of their names before they work.

  15. moshu
    Member
    Posted 2 years ago #

    I am my own host,

    Unfortunatley, that tends to be the worst case scenario - where we cannot really help. We don't deal with server setup issues. Don't even ask :)

    But your permalinks now don't work. Click on any post title and you get a 404.

  16. paul
    Member
    Posted 2 years ago #

    Well, by saying that, you're making it sound like WordPress is hard to integrate and we both know that ain't so.

    I guess I'll have to go to the codex and see if I can find the setup requirements.

  17. paul
    Member
    Posted 2 years ago #

    Hmm, it looks like no matter what I change in the UI, .htaccess never changes. My guess is that's not the correct behavior.

    Yes, I just made a lot of changes via the UI and the .htaccess file never changes (though mod times is updated). I can move it aside and have WP create a new one, same as the old.

    is that a feature?

  18. moshu
    Member
    Posted 2 years ago #

    My guess is that's not the correct behavior.
    Your guess is wrong :)
    The htaccess is always the same - since 2.x - and the rewrite rules are handled internally. However, for some mysterious reason (don't ask, I am not a coder) htaccess has to remain writable when creating a new Page. This is based purely on empirical experience...

  19. paul
    Member
    Posted 2 years ago #

    Well, then why does this page exist if .htaccess is static and all the magic happens internally?

    I'm not saying it doesn't happen that way: my old .htaccess contained nothing more that the mod_rewrite invocation. But it does seem confusing to have a lot of stuff on manually maintaining a file that never needs to be changed.

  20. paul
    Member
    Posted 2 years ago #

    If I am reading this right, I never did have "pretty printed" permalinks, but PATHINFO. I always had index.php in there.

    So how do I get back to that?

    mod_rewrite works. there is a valid .htaccess file.

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

    What needs to happen to make these permalinks work again?

    wordpress/index.php/archives/%year%/%month%/%day%/%postname%

    If this isn't handled in the .htaccess file it must live in the database. Else how would these setting survive a restart?

  21. paul
    Member
    Posted 2 years ago #

    Just to resolve this, the answer is here.

    The synopsis: the rules are stored in the database, as the field "rewrite_rules" in the table wp_options. Simply cleaning out that field and forcing a rebuild through the usual steps was all it took.

    That sounds like a misfeature to me: not everyone is going to be thrilled at the prospect of monkeying with their database directly.

Topic Closed

This topic has been closed to new replies.

About this Topic