I have a folder named "folder1" in the root directory
www.domain.com/ www.domain.com/folder1
I need to redirect all requests to www.domain.com that turned into 404 error to folder1. For instance:
www.domain.com/a_file.txt
If the a_file.txt file does not exist, look in folder1:
www.domain.com/folder1/a_file.txt
I want this to work the same for subdirectories, for example:
www.domain.com/a_folder (redirect if it does not exist in the root directory)
www.domain.com/folder1/a_folder
I know that I should use RewriteCond% {REQUEST_FILE}! -f, but I canβt understand what it is.
source share