# 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
- wp-content/uploads/year/month returns 404
- WordPress 3.5: Setting custom “full URL path to files” in the Media Library?
- Get $image_id after uploading with media_sideload_image()
- simple solution for restricting access to (some) uploads/downloads
- how to upload and allow downloads of .mobi and .epub formats
- Organize uploads by year, month and day
- Different upload directory based on post type in a theme
- Media not actually deleted on disk when click “Permanent Delete”
- Add inline uploader to plugin option page
- Could a large quantity of files in the uploads folder affect performance?
- WP 3.5 media manager – how to create a working gallery frame
- How to call WP3.5 Media Library manager?
- What are the security reasons to disallow Microsoft Word uploads?
- WordPress Media Manager – limit to specific mime type
- Override json encoding in rest api
- Place static HTML files in path below WordPress page
- Manipulating Media uploader
- How to limit file type to be upload?
- Benefits of storing uploads in an assets folder?
- Removing rules from .htaccess
- Create custom tab in WordPress 5 media upload
- How to Check Disk Space used by Media Library
- Add/change multipart_params parameter when uploading post image
- Use WP_Filesystem to list files in directory
- White-list file types for media upload
- Gravity Forms – Repeatable “File Upload” field using “gform_column_input_content” filter [closed]
- Intercept request to /wp-content/uploads/random.file
- Add a YouTube or Vimeo video as a post attachment?
- WordPress multisite causing Error 101 (net::ERR_CONNECTION_RESET): Unknown error [duplicate]
- Upload files to wp-content/uploads – What to add in DB?
- Front-end Image Upload with Preview – Is this Possible in WP?
- Hook or function to upload media via url
- Prevent renaming of uploaded media
- Is it safe to delete uploaded photos if Photon (Jetpack) is activated?
- How do I get allowed Media Library upload file extension list?
- How to manage a big collection of files with wordpress?
- Why is my mod_rewrite not working?
- Override htacces rule only for specific directory
- Allow only attachment uploaded to current post
- Use the WP media uploader dialog for uploading a form attachment (non-admin). Offering progress and drag and drop feedback
- using wp_insert_attachment() results in guids with file names different to the same file when uploaded via media page in admin
- Separate Uploads folder on other server
- How to disable plupload completely from latest wordpress 3.6 and make browser upload default
- Restrict access of admin uploads to certain logged-in users?
- upload_mimes not accepting CSV
- Receiving 404 when uploading file larger than 10kb
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- making media URL secured
- How to protect specific uploaded files from being accessed by non-logged-in users in WP-multisite
- Is it safe to allow non-admin users access to media uploader
- WYSIWYG editor with image upload for “Normal Users” [closed]
- 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
- 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]
- 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
- 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
- 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
- Drag and Drop Media Not Working in Windows 10 Edge Browser
- Exclude some photos in media library
- Failed to load resource at admin screen
- 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
- 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
- Is it possible to restrict the number of media uploads (photos) per user?
- Cannot Upload Video (MP4) File
- Can not access .txt file which I uploaded through media
- How allow only the uploading user access to media