You’ll need to add a rewrite rule to your .htaccess
:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !/wp-admin/ [NC]
RewriteRule ^wp-content/uploads/.+?\.(jpe?g|png|gif|svg)$ /my-page [R=301,L]
</IfModule>
Add this after anything added by WordPress. You’ll need to replace /my-page
with the slug of the page you’d like to redirect to.
Related Posts:
- How to redirect homepage to actual URL?
- i want to change URL of WordPress image or rewrite in runtime
- Images in sub-pages fail to load
- How do I get the avatar URL instead of an HTML IMG tag when using get_avatar?
- Programmatically get images by URL and save in uploads folder
- Function to get URL of original uploaded image – full size
- How to reference a theme image in a stylesheet?
- Mixed content warnings after changing site adress from HTTP to HTTPS
- Redirecting WordPress /.htaccess / HSTS / SSL
- Fixing external image urls
- Preview Image Path in Admin Section
- Why would image paths in wordpress suddenly change?
- Server (WordPress) redirects files that are not supposed to (using htaccess)
- How to store media files in subdomain
- Remove the http protocol from images
- How do i reference the theme path in pages for images?
- @wordpress/create-block image url in css
- Alias ‘wp-content’ directory to something shorter (framework?)
- WordPress url image redirect to the homepage
- Broken urls with http site and https wp-admin
- A way to change image urls in post to cdn image url?
- How to change image url?
- Redirect home to another page with htaccess
- Update image links in database
- Shortcode for a link and thumbnail
- media_sideload_image with rewritten urls?
- add_rewrite_rule fro html to another url not working
- Changed permalink structure. Need help with redirecting old posts
- How to redirect URL with subfolder to the same URL but without subfolder?
- Wildcard forward all posts and pages with few exceptions
- Regex expression for redirecting image URLs to another folder
- reducing number of URL Redirects and increasing speed
- How to add an image to a custom url?
- images not showing after transfer
- URL masking of subdomain to main domain using .htaccess
- Change media URL (images)
- Redirect to another page using contact form 7? [closed]
- Is WordPress API visible from PHP file called in htaccess
- How to make my site use HTTPS for images or how to insert images as relative paths?
- Clicks registering on Preview DNS site
- Migrated site – Images have 404 error
- Is it possible to enable the ‘Link To’ field under ‘Attachment Display Settings’ for a Featured Image?
- Using a .pdf file as a page in wordpress
- How to get image URL from media_sideload_image?
- Exclude image url from search query
- How to pass on a value as parameter via url to another page
- How to replace post image url before posting using api?
- Deleted Image giving a 301
- Hide or mask the url to an image
- Glitched page redirects to image
- How to show a full page when someone links directly to an image on my site
- Redirect only PDFs in different folders?
- Bypass wp_safe_remote_get()?
- Which tools should I use for a gallery that uses an API and url for the path of the images?
- List sub pages with custom field content converting image ID to URL
- Redirect Causes Missing Images
- different CNAME to corresponding subfolders
- Change the image for a certain URL
- How to watermark wordpress images from wp-content/uploads folder with htaccess and php?
- Setting name of attachment URL
- Search and replace image urls in posts
- Protocol relative url not pulling up images on IE, FF, and OPERA
- Broken image URL
- How do I mitigate the forward slash problem for URLs of images after a WP migration?
- get_post_custom: get image URL instead of image ID
- Some images 404
- Are image addresses security relevant?
- Remote Image (from URL) as Media Library element
- Redirect ignore last URL segment
- Multisite image URLs incorrect in editor
- WPALLIMPORT Exporting images from repeater field [closed]
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Masking wp-content/themes/name/images to just images directory using htaccess
- Disable ONLY URL auto complete, not the whole canonical URL system
- get_post_gallery_images returns thumbs . I want full size
- How to append a URL parameter to all outbound URLs
- Specific URL has 403 Forbidden status code
- Generate image size, based on the image-orientation
- How to Add extra option to Image Block Settings?
- Automatically replace original uploaded image with large image size
- Problem with loading images from child theme CSS file with relevant path
- Add suffix to uploaded images
- How to add image in rss?
- Redirect htaccess [closed]
- How to set a Background image in WordPress?
- Images don’t load erratically
- Weird encoded error when using wp_generate_attachment_metadata()
- Hiding Media Source Links
- resize and crop thumbnail photos
- WordPress Multisite: Images moved to /sites/1?
- Run function before uploaded image is saved
- wordpress images not showing properly
- variable crop option with add_image_size()
- How do I get resized thumbnails?
- How do I embed an image at actual size?
- Storing images on a local site
- Tried everything but Facebook share button won’t load the post thumbnail
- URL Custom Rewrite
- Set image dimension for WP_Customize_Image_Control images
- Uploading media to wordpress API with C# HttpClient