RewriteEngine on
#Включает mod_rewrite притом не надо его 10 раз вклчать а иф мод реврайт так вообще можно убрать, и так будет работать.
RewriteBase /
# базовая директория не от корня а от /
RewriteCond %{HTTP_USER_AGENT} ((.*iPhone.*)|(.*iPod.*)|(.*iPad.*)|(.*BlackBerry.*)|(.*Android.*Mobile.*)|(.*Windows\ CE.*)|(.*IEMobile.*)|(.*Opera\ Mini.*)|(.*Opera\ Mobi.*))
# если юзер агент и перечисления или или
RewriteCond %{REQUEST_FILENAME} !\.(jpg|gif|png|css|js|txt|ico|pdf|bmp|tif|mp3|wav|wma|asf|mp4|flv|mpg|avi|csv|doc|docx|xls|xlsx|ppt|pptx|zip|rar|tar|gz|dmg|iso)$ [NC]
# и не перечень файлов кстати желательно обознатчить что до точки что-то есть минимум 1 символ!
RewriteCond %{SERVER_NAME} ^!m\.stroyartel-kazan\.ru(/|)$ [NC]
# и сервер нейм куда правельней в использование
RewriteCond %{QUERY_STRING} (^|&)!no_redirect=true($|&) [NC]
# и условие и или и сам квери (складывается с другими гет запросами)
RewriteRule ^(.*)$ http://m.stroyartel-kazan.ru/$1 [L,R=302]
#Ну и редирект без сохранения ГЕТ параметра !
# или такой вариант, какой больше нравится.
RewriteCond %{SERVER_NAME} ^!m\.stroyartel-kazan\.ru$ [NC]
RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml¦application/vnd.wap.xhtml+xml" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|benq|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|erics|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|android|mobile|pda|psp" [NC]
RewriteRule ^(.*)$ http://m.stroyartel-kazan.ru/$1 [NC,L]
#######################################################################
RewriteRule ^cat/cottages(.*)$ /catalog/cottages/ [L,R=301]
RewriteRule ^cat/houses(.*)$ /catalog/dachi/ [L,R=301]
RewriteRule ^cat/buildings(.*)$ /catalog/buildings/ [L,R=301]
RewriteRule ^cat/bath(.*)$ /catalog/bani/ [L,R=301]
RewriteRule ^play-complex(.*)$ /catalog/childish/ [L,R=301]
RewriteRule ^bul(.*)$ /catalog/childish/ [L,R=301]
RewriteRule ^karkasnye-doma.html /catalog/ [L,R=301]
RewriteRule ^cat/ /catalog/ [L,R=301]
RewriteRule ^about/ /front/about-us/ [L,R=301]
RewriteRule ^service.html /services/ [L,R=301]
RewriteRule ^brus.html /catalog/cottages/dvoynoy/ [L,R=301]
RewriteRule ^production.html /catalog/cottages/ [L,R=301]
RewriteRule ^nanocork-types.html /nanocork/vidy-materialov/ [L,R=301]
RewriteRule ^nanocork-price.html /nanocork/tseny/ [L,R=301]
RewriteRule ^complete/ /our-work/ [L,R=301]
RewriteRule ^stock.html /akcii/ [L,R=301]
RewriteRule ^reviews/ /otzyvy/ [L,R=301]
RewriteRule ^arbolit.html /catalog/ [L,R=301]
RewriteRule ^news(.*)$ / [L,R=301]
RewriteRule ^nanocork-sealant.html /nanocork/germetik-nanocork/ [L,R=301]
RewriteRule ^our/ /our-work/ [L,R=301]
RewriteRule ^ressy-cat.html /ressi/catalog/ [L,R=301]
RewriteRule ^ressy-example.html /ressi/calculation/ [L,R=301]
RewriteRule ^ressy-principeofworking.html /ressi/rule/ [L,R=301]
RewriteRule ^ressy-product.html /ressi/ [L,R=301]
RewriteRule ^doma-iz-kleenogo-brusa.html /staty/dom-iz-kleenogo-brusa/ [L,R=301]
######################################################################
# чпу всегда внизу!!!
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<Files beget,info>
order allow,deny
deny from all
</Files>
# допиши требование для гугл пейдж спид
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/svg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/javascript "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>