How not to cache redirections?
-
There are more problems arising, its not the plugin’s fault, but the way my site works that makes it unusable.
I have more than 20.000 photos, I must redirect each URL of them to the parent post, I don’t like the Yoast option that redirects the image URLs to the file itself.
So, I left the yoast redirection deactivated and use instead this code in image.php
<?php wp_redirect( get_permalink( $post->post_parent ), 301 ); exit; ?> to do the redirection to parent post.But, here the funny behavior starts.
For every attachment URL, the cache enabler creates a separate cache file with the name of the image inside every post’s folder.
If I try to reload the same image to check the redirection or the header’s status, a white page is loading.
This is normal as the created file is not complete as I see.Must be a way to tell the plugin not to cache the redirections, but only the destination URLs.
By the time plugin is deactivated until a solution is found.
- The topic ‘How not to cache redirections?’ is closed to new replies.