RewriteCond and RewriteRule
AnsweredHello I hope everyone is safe and healthy. Happy Mother's day to all mothers!
Can someone enlighten me as to what these rewrite conditions do in plain english:
RewriteCond %{HTTP_REFERER} !^https://www.somename.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://www.somename.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
-
Hey there! Not teeeeeechnically related to cPanel, but I'll give it a shot :D
It looks like this is taking direct access to images and returning a 403 Forbidden error to the client. F is the forbidden error and NC make the file case-insensitive.
https://httpd.apache.org/docs/2.4/rewrite/flags.html
The first two rules there seem to setup what gets rewritten, so it can either be the exact domain.com/image or a subdirectory.
0 -
Thank yhou cPRex - I finally figured that out and yes that's correct. It's to stop vagrants from shopping my images in my sites. Appreciate the fast response. SOLVED
0 -
You're very welcome!
0
Please sign in to leave a comment.
Comments
3 comments