RewriteEngine on
# Старые статьи с лунным календарем перенаправляем на новые
RewriteRule ^horoscope/lunnyj-kalendar-na-god/lunnyj_kalendar_na_(.*).html(/?)+$ redirect.php?cal=common&moon_month=$1 [L]
RewriteRule ^horoscope/lunnyj-kalendar-na-god/([0-9]+)_(.*)_([0-9]+)_goda.html(/?)+$ redirect.php?cal=common&moon_day=$1&month=$2&year=$3 [L]
# Перенаправление feedback.php на /site/feedback
RewriteRule ^feedback.php$ /site/feedback [L,R=301]
# Перенаправление страниц без слеша на конце на страницы со слешем
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.html)
RewriteCond %{REQUEST_URI} !(.xml)
RewriteCond %{REQUEST_URI} !(.png)
RewriteCond %{REQUEST_URI} !(.jpg)
RewriteCond %{REQUEST_URI} !(.gif)
RewriteCond %{REQUEST_URI} !^/site/(.*)$
RewriteCond %{REQUEST_URI} !^/gii(.*)$
RewriteCond %{REQUEST_URI} !^/ajax/(.*)$
RewriteCond %{REQUEST_URI} !^/debug/(.*)$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*[^/])$ $1/ [L,R=301]
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php
# use index.php as index file
DirectoryIndex index.php