Apologies if this question is too simple or in the wrong place but I want to
noindex everything but image files on the server. I'm using WordPress as a headless CMS, yet some images are being sourced directly from my server and I still want them indexed, while everything else, I don't need indexed.
I've experimented with the following but my syntax is wrong or semantically I'm breaking some rules:
#<Files ~ "\.(?!png|jpe?g|gif)$"> # Header set X-Robots-Tag "noindex" #</Files> #<FilesMatch ".+\.(gif|jpe?g|png)$"> Header set X-Robots-Tag "noindex" #</FilesMatch>
As it's currently set up, everything is set to noindex. How do I exclude image formats?