WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress can't find my new pages (23 posts)

  1. jakobud
    Member
    Posted 4 years ago #

    On a different WordPress installation, I previously created a custom theme. It's pretty basic really.

    I just installed WordPress on a clients server and when I create a new page or try to view a post, WordPress can't find the page/post. I get a 404 not found error. But the weird thing is, WordPress isn't even finding my 404.php template page. It's displaying the default browser 404 page.

    Where should I look first to figure this out?

  2. Patrick Daly
    Member
    Posted 4 years ago #

    Try regenerating your permalinks.

    Settings > Permalinks

  3. bh_WP_fan
    Member
    Posted 4 years ago #

    Log into your Dashboard and save your permalinks again. See if that helps. If it doesn't, provide a link to your site so someone here can see the error.

  4. xdesi
    Member
    Posted 4 years ago #

    Sounds like a permalinks issue if it's not displaying your 404.php

  5. jakobud
    Member
    Posted 4 years ago #

    Okay so it looks like the default permalinks are okay. It's just any other type of permalink gives me 404s. What do I need to add to my htaccess to get this working?

  6. s_ha_dum
    Member
    Posted 4 years ago #

    What do I need to add to my htaccess to get this working?

    Exactly what the message tells you to add when you save your permalinks. Scroll down a little.

  7. jakobud
    Member
    Posted 4 years ago #

    Where am I supposed to see this .htaccess message? On the Settings > Permalinks page? Cause I don't see anything about .htaccess on there.

  8. s_ha_dum
    Member
    Posted 4 years ago #

    The message should be directly below the submit button in Settings->Permalinks, but it doesn't show up at all if the .htaccess file is writable by the server. If its writable, WP will write the file for you. If you don't see the message then presumably WP is able to write the file. Have you checked to see what is in your .htaccess? It should look a lot like this, but likely won't match exactly

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

    I guess I'm assuming you are on an Apache server. Any idea what server your site is running on?

  9. jakobud
    Member
    Posted 4 years ago #

    Ah ya its CentOS and Apache. So if .htaccess is writable my WordPress it would take care of it?

  10. jakobud
    Member
    Posted 4 years ago #

    Okay WordPress did write to my .htaccess after I gave it proper write permissions. It wrote this:

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

    However, it did not fix the problem. I'm still get 404 errors on my permalinks.

  11. jakobud
    Member
    Posted 4 years ago #

    And according to phpinfo(); Apache does indeed have mod_rewrite loaded.

  12. s_ha_dum
    Member
    Posted 4 years ago #

    Check the two '(URL)' listings in Settings->General-- third and fourth input boxes from the top.

    Is there an url where I can see the problem?

  13. jakobud
    Member
    Posted 4 years ago #

    The WordPress address and Blog address are both set to the url of the site: http://wordpress.huebnerpetersen.com

    Permalinks are set to Month & Name

    My .htaccess is writable my WordPress. The contents are:

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

    # END WordPress

  14. s_ha_dum
    Member
    Posted 4 years ago #

    Disable all of your plugins and switch to the default theme.

  15. jakobud
    Member
    Posted 4 years ago #

    Done.

  16. alism
    Member
    Posted 4 years ago #

    Is it worth giving WordPress a helping hand with the ErrorDocument?

    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
  17. jakobud
    Member
    Posted 4 years ago #

    That doesn't help. WordPress can't find any of my pages, specifying "404" as the page to goto for a 404 error doesn't help it. It can't find /news/ or /about/ or whatever.

  18. s_ha_dum
    Member
    Posted 4 years ago #

    Do you have allowoveride set on the server?

  19. jakobud
    Member
    Posted 4 years ago #

    According to the WordPress permlinks/.htaccess documentation I have the following set in my .htaccess

    Options FollowSymLinks
    AllowOverride All
    
    # BEGIN WordPress
    
    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
  20. s_ha_dum
    Member
    Posted 4 years ago #

  21. jakobud
    Member
    Posted 4 years ago #

    Ah lemme check on that. What exactly should I be looking for?

  22. jakobud
    Member
    Posted 4 years ago #

    Fixed it! You are my savior! I remember reading that on the permalinks page before but I thought "surely the last tech guy who set this server up was smart enough to enable that" so I never bothered looking. Sure enough... It was set to "None". Woo thanks!

  23. Dorimkim
    Member
    Posted 4 years ago #

    Hey
    I have the same problem that you had. I created a blog using wordpress and uploaded a pre-made theme. I created pages. I can see index page perfectly. But when I click any of my pages or posts, the pages don't show up.

    In setting/permalink, if I choose the default option, when I press the page, a pag shows up as below.

    [To Parent Directory]
    http://www.mydomain.info-/wordpress/
    indexlicensereadme
    wp-admin
    wp-app
    wp-atomwp-blog-header
    wp-comments-post
    wp-commentsrss2wp-config-sample
    wp-configwp-contentwp-cronwp-feed
    wp-includeswp-links-opmlwp-load
    wp-loginwp-mailwp-passwp-rdf
    wp-registerwp-rsswp-rss2
    wp-settings
    wp-trackbackxmlrpc

    if I choose Day and Name or Month and name or Numeric, the pages show that there is 404 error. I don't know how to use custom structure or optional

    It seems you have figured it out. Can you please explain the detailed steps to solve the problem if you don't mind?

    Where can I see WordPress permlinks/.htaccess?
    Where can I set allowoverride?
    Look forward to hearing from you.
    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.