parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

Решено, прокачал знание mod_rewrite

Webnode 21.04.2011 09:19 / 21.04.2011 09:20

Дело всё во флажке "С" - связать надо было правила.
Ну и мелочи типа "название категории не начинается с цифры"
Всё работает как надо, спасибо коллеги!
RewriteEngine On

# parent category and sub cat of catalog - with page
RewriteCond %{REQUEST_URI} ^/catalog/(\D[\w-]+)/(\D[\w-]+)/(\d+)/?$
RewriteRule . - [e=perm_name:%1~%2~%3,C]
RewriteRule ^(.*)$  /oldver/catalog.phtml${catalog_static_url:%{ENV:perm_name}} [L]

# parent category and sub cat of catalog - without page
RewriteCond %{REQUEST_URI} ^/catalog/(\D[\w-]+)/(\D[\w-]+)/?$
RewriteRule . - [e=perm_name:%1~%2~,C]
RewriteRule ^(.*)$  /oldver/catalog.phtml${catalog_static_url:%{ENV:perm_name}} [L]

# parent category  of catalog - with page
RewriteCond %{REQUEST_URI} ^/catalog/(\D[\w-]+)/(\d+)/?$
RewriteRule . - [e=perm_name:%1~~%2,C]
RewriteRule ^(.*)$  /oldver/catalog.phtml${catalog_static_url:%{ENV:perm_name}} [L]

# parent category  of catalog - without page
RewriteCond %{REQUEST_URI} ^/catalog/(\D[\w-]+)/?$
RewriteRule . - [e=perm_name:%1~~,C]
RewriteRule ^(.*)$  /oldver/catalog.phtml${catalog_static_url:%{ENV:perm_name}} [L]

# just root of catalog - with page
RewriteRule ^(\d+)/?$  /oldver/catalog.phtml?pg=$1 [L]

# just root of catalog
RewriteRule ^$  /oldver/catalog.phtml [L]