Подскажите, как можно с эмитировать вот такое htaccess правило:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-z0-9-_]+\/)(.*)$ /$1index.php?req=$2&module=$1 [QSA,L]
тобишь если есть шлем все запросы в папку, остальное передаем в переменной $req
Например запрос: /catalog/section_1/section_2/section_3/?aa=11&bb=22
В папке /catalog/ получаем:
Array
(
[req] => section_1/section_2/section_3/
[module] => catalog
[aa] => 11
[bb] => 22
)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-z0-9-_]+\/)(.*)$ /$1index.php?req=$2&module=$1 [QSA,L]
тобишь если есть шлем все запросы в папку, остальное передаем в переменной $req
Например запрос: /catalog/section_1/section_2/section_3/?aa=11&bb=22
В папке /catalog/ получаем:
Array
(
[req] => section_1/section_2/section_3/
[module] => catalog
[aa] => 11
[bb] => 22
)