How can i redirect Attachment image to the coupon post
Hello every one.
Can someone tell how we can redirect Attachment image to the coupon post.
for example my site is
http://code-shopping.fr/
and I have a lot of attachment pages like :
http://code-shopping.fr/?attachment_id=1138.
the problem is they are poor pages without content, when search engine index them they will hurt
SEO Ranking a lot.
I have tried a lot of methods but no success :
I replaced entire attachment page template with this code:
PHP Code:
<?php wp_redirect(get_permalink($post->post_parent)); ?>
but the redirect doesn't work.
I created an image.php with this code:
PHP Code:
<?php wp_redirect(get_permalink($post->post_parent)); ?>
but also redirect doesn't work, get an error.
I use a redirect plugin:
but also don't work.....Can some one help.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
My Sites :
Eden Deco Coupon and
Darty Code