Title: PHP Query causes 404 error
Last modified: August 21, 2016

---

# PHP Query causes 404 error

 *  [azda](https://wordpress.org/support/users/azda/)
 * (@azda)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/php-query-causes-404/)
 * I have been using the code below to post blog posts.
 * _[ Moderator note: please wrap code in [backticks or use the code button](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Don’t use `strong` as it mangles the code. ]_
 *     ```
       <?php
       require('../path/wp-blog-header.php');
       ?>
   
       <?php query_posts('cat=35'); ?>
       <?php while (have_posts()) : the_post(); ?>
       <a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
   
       <?php endwhile;?>
       ```
   
 * I noticed that my site was not being indexed by google. So I used the web testing
   tools at [http://www.webpagetest.org/](http://www.webpagetest.org/)
 * The test returns a 404 code which means Google thinks the page do not exist.
 * I also noticed that my other sites which use the same code do not get 404 errors
   and are indexed by Google.
 * The problem is now happening when I put the code on plain page
 * All the blog posts exist and are displayed properly and the website itself exists
   and loads quickly
 * What is causing the 404 error ?
 * Please help

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Krishna](https://wordpress.org/support/users/1nexus/)
 * (@1nexus)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-query-causes-404/#post-3947323)
 * Site URL?
 *  Thread Starter [azda](https://wordpress.org/support/users/azda/)
 * (@azda)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-query-causes-404/#post-3947387)
 * The test page is located here :
 * [http://kenyapage.net/basket/index4.php](http://kenyapage.net/basket/index4.php)
 * The blog is located at [http://www.kenyapage.net/commentary](http://www.kenyapage.net/commentary)
 * The test page has no other text besides the php query.
 * I am using [http://www.webpagetest.org/](http://www.webpagetest.org/) to test
   it and it returns a 404 error

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP Query causes 404 error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [azda](https://wordpress.org/support/users/azda/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/php-query-causes-404/#post-3947387)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
