Want to protect WordPress uploads folder? This example will only accept images files. If you want to upload other file types, add the file extensions to the list.
1 2 3 4 5 6 7 8 9 10 | # BEGIN WordPress <Files ~ ".*..*"> Order Allow,Deny Deny from all </Files> <FilesMatch ".(jpg|jpeg|jpe|gif|png|tif|tiff)$"> Order Deny,Allow Allow from all </FilesMatch> # END WordPress |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.