404 Admin Error

I found the solution. I had to open up phpMyAdmin open up the database then open up wp_options. From there I had to change the siteurl and add /wp to the end and it works again.

Multiple 404.php templates based on a post_type

It is possible but wordpress doesn’t have any helpful constructs to help with that. The best approach is to modify your 404.php. Most of the information that you need should be in the main WP_query object and you should be able to do something like if (is_singular(‘post_tyoe_a’)) { …. } else { …. } this … Read more

Fix 404 error after changing permalink structure

If your .htaccess file were writable, wordpress do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. 1- Open .htaccess file and copy following data in that file. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . … Read more

Need 404 behaviour for blank parent page

In functions.php function productsPageRedirect_404() { global $post; if( is_page(‘products’) ) { global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( ‘wp’, ‘productsPageRedirect_404’ );

No 404 page available

There is 404.php in the theme uploaded. But when there is search for non-existent page. The 404.php does not show up. When there is search for non-existent page doesn’t produce the 404 page, but simply shows the search.php‘s else portion. A simple search.php is like: <?php if( have_posts() ) : ?> <?php while( have_posts() : … Read more

404 not working on main site on multisite

The cause of your problems is this line: define( ‘NOBLOGREDIRECT’, ‘http://www.ncc.my’ ); If a user visits a blog that doesn’t exist, e.g. http://example.ncc.my this is where the user is sent. However there are also sub directory installs, so all requests that aren’t found are sent there. The easy fix would be to set up a … Read more