I have a subdirectory called /i/ where I have images and videos saved. Files like png, gif, and mp4.
I have some code in the .htaccess file to silently redirect from root to /i.
Example: domain.com/awE1.png is silently redirected to domain.com/i/awE1.png
Code:
RewriteCond %{REQUEST_URI} !/i/ [NC]
RewriteRule \.(?:jpe?g|gif|bmp|png|tiff|ico|mp4)$ i%{REQUEST_URI} [L,NC]
The problem is, if there is a file in the root folder, or another subdirectory such as /s and the file is an image, it will just result in a 404 error. Is there any way I can make .htaccess only look for the predefined file extenstions in the root folder?
Thanks!