I have a bit of a problem/issue what is freaking me out a bit. I hope you can help me. If i do site:www.somesitename.com search in Google i see that Google is indexing my attachment pages. I want to redirect attachment URL's to parent post and stop google from indexing them.
I have used different redirect plugins in hope that i can fix it myself but plugins don't work. I get a error:"too many redirects occurred trying to open www.somesitename.com/?attachment_id=1982 ".
Do i need to change something in my attachment.php fail? Any idea what is causing this problem?
<?php /** * The template for displaying attachments. * * @package WordPress * @subpackage */ get_header(); ?> </div> <!-- /#header-bg --> <div id="content-wrap" class="clearfix"> <div id="content" role="main"> <h1> </h1> <div id="main-content"> <?php /* Run the loop to output the attachment. * If you want to overload this in a child theme then include a file * called loop-attachment.php and that will be used instead. */ get_template_part( 'loop', 'attachment' ); ?> </div> <!-- /#main-content --> <div id="side-content"> <?php get_sidebar(); ?> </div><!-- #side-content/ --> </div> <!-- #content/ --> </div> <!-- /#content-wrap --> <?php get_footer(); ?>