How to generate 301 error for moved page?
-
I have a very basic Page.php template:
<?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2> <div class="entry"> <?php the_content(); ?> </div> </div> <?php endwhile; ?> <?php edit_post_link('Edit', '<p>', '</p>'); ?> <?php else : ?> <h2>Not found</h2> <?php endif; ?> </div> <?php get_footer(); ?>
I recently moved some Pages that search engines are still generating links to. Is there a wordpress template tag I can use to replace the “Not found” message with a HTTP 301 Moved Permanently error?
Or do I have to write code to identify the page_id of the moved page and use the PHP
header()
function?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to generate 301 error for moved page?’ is closed to new replies.