V
V
vaf762019-04-25 21:36:45
htaccess
vaf76, 2019-04-25 21:36:45

RewriteRule works partially - what's the problem?

Hello. I want to make a mobile redirect of individual pages of the site.
I wrote the following rules in htaccess

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (?i:midp|samsung|nokia|j2me|avant|docomo|novarra|palmos|palmsource|opwv|chtml|pda|mmp|blackberry|mib|symbian|wireless|nokia|hand|mobi|phone|cdm|upb|audio|SIE|SEC|samsung|HTC|mot-|mitsu|sagem|sony|alcatel|lg|eric|vx|NEC|philips|mmm|xx|panasonic|sharp|wap|sch|rover|pocket|benq|java|pt|pg|vox|amoi|bird|compal|kg|voda|sany|kdd|dbt|sendo|sgh|gradi|jb|dddi|moto|iphone|android|XiaoMi)

RewriteRule !(.) http://m.site.ru [R=301,L]

RewriteRule ^kukhni-na-zakaz/krasnye-kuhni.html$ http://m.site.ru/kuhni-na-zakaz/krasnye-kuhni.html [L,R=301]

As a result, the main page is redirected normally, but kukhni-na-zakaz/krasnye-kuhni.html is redirected constantly, i.e. the rules described in RewriteCond for some reason does not work for her

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-04-25
@dodo512

For each RewriteRule, you will have to repeat the RewriteCond condition.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question