Xavier Issac
Xavier Issac

Reputation: 495

Wordpress Default Posts single page is showing 404 file not found on server

I have installed a fresh copy of Wordpress and I have added some posts. When I open the site all my posts are showing, but when I click on a particular page single page is showing 404 file not found on server. I have tried same from clicking view on backend and it's showing same.

I have updated everything .htaccess and permalink to post-structure but not working. Please help me to solve the issue

Upvotes: 0

Views: 79

Answers (3)

Nagender Singh Gehlot
Nagender Singh Gehlot

Reputation: 88

1.Is this working with plain permalink option?

  • Set your custom permalink structure (such as %postname%)
  • Click Save
  • See if your single custom post pages return 404 error pages
  • If they do, go back and change permalinks back to default and save
  • Now try setting the custom permalink again and save

Going back and forth has normally helped fix my errors and I’ve had a lot of success with this method.

2.Check for slug conflicts (having a page with the same slug as your post type) 3.Auto Flush Rewrite Rules (for developers)

// Code for themes
add_action( 'after_switch_theme', 'flush_rewrite_rules' );

// Code for plugins
register_deactivation_hook( __FILE__, 'flush_rewrite_rules' );
register_activation_hook( __FILE__, 'myplugin_flush_rewrites' );
function myplugin_flush_rewrites() {
    // call your CPT registration function here (it should also be hooked into 'init')
    myplugin_custom_post_types_registration();
    flush_rewrite_rules();
}

Upvotes: 1

Chirag Chhuchha
Chirag Chhuchha

Reputation: 395

Does .htaccess is allowed under apache please check your apache.conf and set All to Allowoveride option for /var/www/html and also enable the mod_rewrite with

sudo a2enmod rewrite

And also restart the apache.

Upvotes: 2

Hritik Pandey
Hritik Pandey

Reputation: 949

Please try to disable the current theme and check it with another theme and do this same for plugins. This maybe a plugin/theme conflict issue with wordpress version. Or you can also try to debug this by changing wp-config.php file code from define('WP_DEBUG', false); to define('WP_DEBUG', true);

Upvotes: 1

Related Questions