a 404 error occurs when the requested page cannot be found

learn more… | top users | synonyms (1)

10
votes
2answers
448 views

How to create custom 401, 403 and 500 error pages?

When a 404 error is encountered, a 404.php template file can be used to render a custom error message. This is documented in the Template Hierarchy article. My aim is to create custom error pages ...
9
votes
5answers
2k views

Getting hierarchical custom post type permalinks to work just like pages

I've dug through every question here on custom post type permalinks, but most seem to be either problems with custom taxonomy rewrites, or the obvious missing of flush_rewrite_rules(). But in my case, ...
8
votes
7answers
16k views

Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error

I refer to this question previously asked and not suitably answered: Wordpress overriding actual subdirectories and also Non "Wordpress" pages/code getting 404 error. I have the same ...
7
votes
2answers
4k views

Redirect Restricted Page to 404

Is there a way to show a 404 page if the current logged in user does not have the right clearance to view the page? I am looking for a PHP method, something like if( ...
7
votes
3answers
3k views

Are there any hooks that alter the 404 logic?

Provided you have a 404 page defined in your theme, Wordpress will display a 404 page if "tag" is defined in $wp_query->query_vars, and there are no posts matching that tag. I'm writing a plugin that ...
7
votes
5answers
5k views

How do I skip wordpress's 404 handling and redirect all 404 errors for static files to 404.html?

How do I skip wordpress's 404 handling and redirect all 404 errors for static files to 404.html? I read and it seems its not possible when using permalinks? The objective is to reduce the server ...
6
votes
2answers
2k views

How to Change 404 page title

i have try many methods after searching on internet but unable to ramove Nothing Found from my 404 page title how to do it please help me even i have us this in my 404 page header if( is_404() ) ...
5
votes
1answer
2k views

Why when I submit a form in wordpress it loads a 404 page though URL is correct

I am just creating a simple contact form, but I notice that it seems to post to an invalid page. The url in the browser is correct but the title of the page is "Page not found" on the top of the page ...
5
votes
3answers
1k views

External page integrated into WordPress returns a 404 error

I have a script that I'd like to call via AJAX from my WordPress theme, it relies upon some core WordPress functions so I am including WordPress blog header like so: define( 'WP_USE_THEMES', false ); ...
4
votes
5answers
5k views

How to eliminate weird 404 errors in wp-admin?

I run a WordPress site with about 70 active plugins. Every so often, I'll get a random error page ("Not Found", though I haven't checked the headers to see if it's a 404) on a /wp-admin/ page that ...
4
votes
3answers
919 views

Custom Post Types 404 Issue

I dont know why my custom post types render the Page not found. This is the code I am using to register custom posts. www.example.com/products/product1/ renders 404 where as ...
4
votes
2answers
4k views

Display search results within the same page

Problem I have a page on my site where I need to do additional searching within that page. I am using the default way of WordPress searching with <?php get_search_form(); ?> for my main header ...
4
votes
3answers
1k views

Uploaded image, but not showing

I have a reasonably fresh WordPress install on my Ubuntu Linux server and I uploaded an image to it for use in a blog post. I checked the path in WordPress settings and I checked the contents on the ...
4
votes
1answer
144 views

Making %author% the rewrite slug for custom post type causes 404s on non CPTs

This has been driving me absolutely mad. I created a custom post type which I plan to use to create pretty affiliate/redirect links throughout my site. Here is my register_post_type(): ...
3
votes
1answer
156 views

How to display wp_nav_menu() conditionally only when not on a 404 page?

I made a custom design for my site. On my header i put my navigation so everytime i call the header the navigation will be called to, so that i would not be calling it all the time. But now i have a ...
3
votes
2answers
515 views

Custom post type 404s with rewriting even after resetting permalinks

I created a custom post type, of which the (simplified) arguments are: register_post_type( 'Event', 'public' => true, 'rewrite' => array( 'slug' => 'eventy'), 'has_archive' ...
3
votes
2answers
2k views

Including category-base in a post permalink results in 404

I have static front-page and separate page /news/ as the Posts page. I would like to have the single-post URLs like this: www.example.com/news/categoryname/subcategory/postname/ and for the ...
3
votes
3answers
1k views

404 error on homepage when using Nginx proxying to Apache

I generally use Nginx to serve static content on my server, with Apache handling PHP content using PHP-FPM. However, I'm not able to get a Wordpress blog homepage to display and I've tried all the ...
3
votes
3answers
597 views

Hierachical Custom post types permalinks not working

Been looking for someone with this same problem for hours now so I decided to post my own thread. I have a hierachical custom post type called contact-information. Using this I have parentpages ...
3
votes
0answers
94 views

404 redirection and Google's index [closed]

I have several dead pages, which are annoyingly still indexed in Google. I've set my 404.php to redirect to my homepage using wp_redirect, however I'm worried that this will prevent Google from ...
2
votes
5answers
3k views

How to force a 404 on WordPress

I need to force a 404 on some posts based on conditions. I managed to do it ( although I don't know if I did it the right way) and I'm a getting my 404.php template to load as expected. My code: ...
2
votes
2answers
1k views

How to trigger 404 for custom query var?

How can you trigger a 404 when using custom query vars? I've got re-write rules written for a custom query var, but if you were to request a URL for the query var that should technically be a 404 it ...
2
votes
3answers
5k views

Custom post type pagination 404 fix?

Been trying to get this working all day but haven't had any luck... I have a custom post type called 'news' and an archive template (archive-news.php), here I'd like to show 2 posts with pagination, ...
2
votes
2answers
2k views

Custom post type archive 404's with paginate_links

im using paginate_links function to create pagination on my custom post type archives, no matter what i do im hitting 404 errors when going to view page 2 (ie clicking to go on one page in the ...
2
votes
1answer
2k views

404 when fetching image from wp-content/uploads/

I get 404 status when fetching images, and the http still contains that image. Image shows up in a browser, but the 404 code breaks some applications. calls to wp-content/uploads/ are redirected in ...
2
votes
1answer
1k views

Pagination with custom post types results in 404 issues

I've a very simple index.php: <div id="content"> <? get_template_part('content', get_post_format()) ?> </div> <div id="pagination"> <? previous_posts_link() ?> ...
2
votes
3answers
2k views

Non existing blog pages are not redirected to 404

I've got a page called Blog. In the Settings -> Reading I've set my Blog page as Posts page. In the menu when I click on the Blog link the posts are loaded correctly and pagination works, so far so ...
2
votes
1answer
62 views

Putting footer content in a “page” - Doing it wrong?

So, in my shortish WordPress development career, I've gotten in the habit of creating a "page" for the content in a footer, and adding different fields with the wpalchemy class. Everything with this ...
2
votes
1answer
556 views

Check if post is in draft or pending review?

Each of our posts are reviews for individual games and we occasionally have to 'pause' the game by changing it from published to pending review. The problem is if the page is indexed by search ...
2
votes
1answer
209 views

Redirect feed to 404 page

I would like to redirect my visitors to my 404 when they visit any feed of my page. Something like this. I would liek to do this without changing the header URL. function fb_disable_feed() { // ...
2
votes
1answer
691 views

Debugging WP routing

For some posts, I see 404 page, even though posts exist, where is the place in WP where using permalink is decided what object needs to rendered? Thanks!
2
votes
4answers
1k views

How to fix strange 500 Error after Editing Menu?

I have strange situation which just started which I seem to be unable to resolved. I am not sure what this might be related to but I think I remember reading somewhere that this has happened to ...
2
votes
2answers
305 views

Wordpress Theme's 404.php not found, server defaults to Apache's own 404 page

if I just type something to provoke a 404 Error on my Wordpress installation, Wordpress doesn't load its own 404.php file, but the Apache server's own 404 error message gets displayed. What is wrong ...
2
votes
2answers
340 views

get_the_ID() gives notice in 404 page

I'm using get_the_ID() in my wp_enqueue_scripts action due to some needs, But as result I'm getting the following notice (wp-debug is on): Notice: Trying to get property of non-object in ...
2
votes
1answer
658 views

Custom Taxonomy Leads to 404 Page - Permalink Structure Flushed

I have a CPT: function CPT_init(){ register_post_type('custcpt', array( 'labels' => array( 'name' => __('Products'), ...
2
votes
1answer
175 views

Detect 404 before headers are sent

I've a piece of code that shows a banner the first time a user visits, then sets a cookie, which prevents it showing again. However, if the page has a 404 error, the 404 page of the requested ...
2
votes
1answer
166 views

Some posts returning 404 instead of displaying post

I'm having a problem with my Wordpress install. All of a sudden some of my posts return 404 errors when I try to go to their permalink. My post names are all numbers and this started happening when my ...
2
votes
1answer
132 views

Create second custom 404 page for selected post type

I created a new custom post type called event, which works fine. I also created a custom 404 page template, which is shown if a event/page/post is not found. But now the hard part, i want to create ...
2
votes
1answer
1k views

Setting 404 page in Nginx

I am using this page (http://wiki.nginx.org/WordPress) to setup my WordPress on a nginx/php-fpm server. Everything is okay, except the 404 page When I request www.example.com/foo, it send me the ...
2
votes
1answer
85 views

In wordpress I am manipulation 404 response. I want to give the response before 404 error is given to google

May be the question in title is not explaining what exactly I want. So I will explain one logic and then ask what problem I am getting from that. We are using wordpress. We have 2 categories ...
2
votes
1answer
1k views

Child pages on hierarchical Custom Post Types 404s

I've been working with Custom Post Types lately and haven't had any major problems. This time I'm trying something new. I want to create a CPT which basically works like Pages, with page hierarchy. ...
2
votes
1answer
56 views

there's a way to include a minimal WP for check only the current user, its roles (caps?) and then release/free it?

I need to count how many times a file in a particular sub-directory is downloaded and track who downloaded it. I'm using a Php file to do it, it isn't a WP file but I need to include WP to get the ...
2
votes
1answer
186 views

New categories are now going to 404s

I have a WPMU site with hundreds of blogs on it. We are on 3.4.2 and this is the first time I'm seeing this issue within a few of my sites. Basically, what happens is that I'll create a new category ...
2
votes
1answer
493 views

Multisite custom post type's single page 404

I have two sites in my multisite setup - domain.tld (site A) and domain.tld/lifestyle (site B). This is my first multisite attempt. I've made a widget that creates a custom post type "latest-news" ...
2
votes
1answer
824 views

Pagination gives 404 error

It's seems that this bug of WP never was solved by WP team. I have custom post-type, my url structure is /%category%/%postname%/ And if i click on 2nd page i will get 404 error. I tried everything i ...
2
votes
1answer
321 views

Best way to strip character entities (%20 etc)

I have a heap of images inside MovableType, on an old server. There are plenty which have character entities like %20 to represent spaces. I've used some plugins to import the images and change the ...
2
votes
3answers
2k views

Preview posts returns 404

It's a large Wordpress multisite installation, using subfolders for the individual blogs, not domains. We are running version 3.1, and preview posts doesn't work. When I press preview I get the ...
2
votes
2answers
1k views

permalink changed, now getting 404 for every pages

i have my website with permalink, till now everything was fine, but few days before i changed my permalink, now everything is going wrong, now each and every page i am getting 404, even my about-us ...
2
votes
0answers
239 views

Inconsistent temporary 404s on whole install | PHP error with post-template.php

I'm deeply confused by this one: I have a WordPress install on a Media Temple GS [one of many which work fine and are configured almost exactly the same] which is occasionally giving me 404s sitewide. ...
1
vote
6answers
2k views

How do I go about fixing this apparently messed up upgrade?

I'm a WordPress novice trying to help a friend (who is even more of a WordPress novice) with his WordPress blog hosted on GoDaddy. It was working fine until he apparently (he doesn't fully remember) ...