Answer the question
In order to leave comments, you need to log in
How to set up a tricky redirect in htaccess?
Hello colleagues! Thank you for coming!
Given: there are folders and files in the d.ru domain folder. One of the folders is /folder/subfolder/ and it contains files such as /folder/subfolder/001.txt and the folder /folder/subfolder/texts/abc.txt. There is no /files folder!
The question is how to make all files and folders go in /index.php, except for files and folders that are physically in /folder/subfolder/ but only open as /files/?
Let me clarify so as not to confuse:
RewriteEngine On
RewriteRule ^files/(.*)$ folder/subfolder/$1 [L,QSA]
RewriteCond %{REQUEST_URI} !^files/
RewriteRule ^(.*)$ index.php [L,QSA]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question