# Only allow access to this directory if they are coming from your domain; excluding you, your server, Google and any other IPs
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^(xxx\.xxx\.xxx\.xxx|xxx\.xxx\xxx\.xxx|66\.249\.)
RewriteCond %{HTTP_HOST} !^(127\.0\.0\.0|localhost) [NC]
RewriteCond %{HTTP_REFERER} !^https?://(.+\.)?yourdomain\.com/ [NC]
RewriteRule .* http://yourdomain.com/ [L]
That should help, I think
Related Posts:
- How to rewrite WordPress uploads folder to another folder using htaccess
- Deny access to uploads folder with exceptions
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- Prevent users from accessing mp3s in my uploads folder?
- How to proxy local WP uploads folder to live site
- Rewrite rule to load images from production does nothing
- Disabling direct access to images using .htaccess
- Password protect any file in WordPress
- Increase .htaccess file upload without prompting error
- How to remove .html from URL?
- How to upload SVG in WordPress 4.9.8?
- Use a separate custom table (not posts) to handle file upload data
- PNG with transparent background turns black when uploaded and resized
- WP 3.3 > Still no option to enable automatic image overwrites?
- Custom upload directory per CPT; when removed, file not deleted
- Modify featured image path to Amazon S3
- How to set an upload directory for each media type?
- How to protect uploads in multisite if user is not logged in?
- WordPress on a subdirectory of Laravel – WordPress pretty permalinks inner page shows laravel
- uploading files to the uploads folder via ftp
- Modify the array of selected images in media modal
- Bypass .htaccess when using download_url
- Remove upload_files capability from a role but allow role to manage an avatar image
- 3.5 media manager add CSS / JS to new ‘tab’ iframe content
- post_id missing from the wp-admin file upload request
- http error when uploading media files
- How can I upload a csv file into WordPress?
- Rewrite rule not working
- How to link to the image editor’s Edit Image function?
- Image uploading stuck on “crunching”
- .htaccess redirects disappeared after re-saving permalinks
- “upload_mimes” filter not working. Need to allow WOFF and WOFF2
- Whole bunch of errors on WP website – media upload, edit slugs, edit screen not working [closed]
- wp_generate_attachment_metadata generates 503 Service Unavailable or 500 timeout errors
- wp_enqueue_media() Will not load JS on the theme
- media sideload image not working with JPG file
- Placing assets for external use
- programmatically create posts from files in a folder
- add_image_size() and uploading the exact size leaves 1×1 image in uploads
- How do I insert an already uploaded video file into my Media Library?
- Change htaccess to redirect to index.php in subfolder
- How to write .htaccess so that https is on for subpages only but not the home page
- Extra “uploads” added in path
- Custom rewrite rule, url returning 404
- Is there a way to make my media files unsearchable?
- Is it possible to use media_sideload_image to upload local files?
- How to switch to year/month directory structure format from a single folder
- mod_rewrite doesn’t work as I want even with JSON API Plugin disabled
- Attach media to post by media category
- Rename attachment filenames to attachment ID on upload
- WordPress Media Library showing wrong preview size?
- How to edit attachment with media-upload.php?
- upload_max_filesize is set to 64 MB already but WordPress is still showing 2 MB
- .htaccess Non-‘www’ to ‘www’ Subdomain Redirection Only Works for Homepage
- How to fix the orientation of images when uploading via the WordPress Media Uploader? [closed]
- Uploading PDF files from the front-end
- Uploads going to the root of wp-content/uploads
- WordPress Images, Header Videos and Carousel is not working live but perfect on Local Host Is It FTP? Filezilla?
- Uploaded image with non-english characters is named incorrectly in upload folder
- Can’t upload images (incorrect “file exceeds upload_max_filesize” error)
- Theoretical limit of upload file size [duplicate]
- Remove Media File Items From Server That Do Not Exist in Media Library
- Cropping thumbnails to specific dimensions on front end post
- Double slash in upload URLs
- Unable to upload new file as a product
- All my files are on my blog! I need sync solution
- Efficient way to move media folder to another folder
- Make inline uploader (plupload) on options page upload to a specific folder
- media file uploading
- htaccess redirect to path
- What is wrong with my wp_insert_attachment code?
- Editor User Role can’t see other users media
- How to allow .ged file uploads
- Media files not loading
- problem when uploading file by metaboxes
- Set attachment category from file name on upload
- HTTP Error WordPress on IIS uploading image
- What folder to place Large Video files?
- _d_improd_ directory in uploads breaking site images
- Organizing the Media Library for Cleanup
- Allow author to upload image via Media button without plugin
- Drag and Drop Media Not Working in Windows 10 Edge Browser
- Exclude some photos in media library
- Failed to load resource at admin screen
- Make custom thumbnail size image in media_sideload_image function
- Upload more than one media files with a post
- .htaccess not working in WordPress
- uploading photos
- How to handle image resize in media_handle_sideload?
- Image uploaded in media library, can only see it when I using the WP Edit Image feature. 404 when trying to view in browser
- Single file upload
- Host Images from Link
- Upload media error: unable to create directory (windows hosting)
- Add frontend editor with media buttons for Visitors and display only their media
- WordPress Custom Fonts Problem! [closed]
- I want to customize wp.media (the wordpress admin uploader) in order to change the file name but only in video custom post type
- Auto shortlink for file uploads
- Obtaining detailed error information from Media file upload process
- Is it possible to restrict the number of media uploads (photos) per user?
- How to restrict product access to personal user uploads in WordPress