Answer the question
In order to leave comments, you need to log in
How to correctly compose a .htaccess rule?
Honestly, it's either evening or whatever, but I just can't figure out the simplest rule.
In general, I have Yii which lies in a directory, let's say:
/v2
(/v2/index.php) - the launch file and let's go
to the root, I have other scripts, and other files that can be loaded.
How to make Apache redirect to Yii any request that doesn't match any root files or scripts?
For files, I assume these commands are needed:
RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteCond %{REQUEST_FILENAME} !-d<br>
require '/v2/index-chdir.php';<br>
// index-chdir.php - спец запускающий файл, с доп кодом chdir(__DIR__);<br>
# если нет файла или директории<br>
RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteCond %{REQUEST_FILENAME} !-d<br><br>
# передать все запросы к прокси файлу<br>
RewriteRule . yiiproxy.php<br>
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