• I want to redirect or remove the image.php (basically the image attachment) page completely, so that Google won’t index those pages that only consists of images I’ve uploaded to the media library (I already have …/image/image.png URL which works for me).

    I can’t identify the location in the phpMyAdmin where those posts are located that contains the images I’ve uploaded (I don’t want …/image.png) in order to delete them.

    I’ve thought about modifying the image.php page, but it looks ridiculous if for example, the image shows a bar of soap, and the URL is ‘…/soap.png’ but the page shows something else instead.

    I do however, have a 404.php, it would be nice to be able to redirect the image attachment / image.php to the 404.php.

    How do I do this?

    I currently have 404.php setup in .htaccess where if you type ‘…/whatever’ it’ll take you straight to the 404.php. I can’t seem to get the ‘/image.png’ to work.

    RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
    RewriteRule ^(.*)$ – [R=403,L]
    
    ErrorDocument 403 /404
    ErrorDocument 404 /404

    This would redirect it to 404 page. If I change it to ?image\.php(.*)$ it doesn’t seem to do anything for those image attachment pages.

    • This topic was modified 4 years, 5 months ago by hifumi. Reason: clarification
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘image.php / image attachment’ is closed to new replies.