Y
Y
Yeah122018-07-09 20:15:58
htaccess
Yeah12, 2018-07-09 20:15:58

.htaccess redirect, google insights?

Greetings toasters, please help me figure out .htaccess, the fact is that I made a mobile version of the site, but that's a problem, the site is static. A few questions:
1. Main site file:

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)
RewriteRule ^.*$ https://сайт.ру/mobile [R=301,L]
RewriteCond %{HTTP_HOST} !^сайт.ру$
RewriteRule ^(.*) https://сайт.ру/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://сайт.ру/ [R=301,L]
ErrorDocument 404 https://сайт.ру/404.htm

2. The mobile version is located at https://site.ru/mobile
RewriteEngine on
RewriteCond %{HTTP_HOST} !^сайт.ру$
RewriteRule ^(.*) https://сайт.ру/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ https://сайт.ру/ [R=301,L]
ErrorDocument 404 https://сайт.ру/404.htm

Then I decided to look at developers.google.com/speed/pagespeed/insights
Here is an error on the mobile version:
Не используйте переадресацию с целевой страницы на следующие URL:[LIST] 
[*]https://сайт.ру/ 
[*]https://сайт.ру/mobile 
[*]http://сайт.ру/mobile/ 
[*]https://сайт.ру/mobile/ 
[/LIST]

What have I done wrong? Where did http come from?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question