Answer the question
In order to leave comments, you need to log in
Should you use a mobile redirect on your site? And how to register it through .htaccess?
Hi all.
I hope I get an answer to this question here.
I want to put a mobile redirect on the site through .htaccess, I write the following code in it
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#redirect mobile browsers
RewriteCond %{HTTP_USER_AGENT} ^.*Android.*$
RewriteRule ^(.*)$ http://saite.ru/m/ [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
RewriteRule ^(.*)$ http://saite.ru/m/ [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
RewriteRule ^(.*)$ http://saite.ru/m/ [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$
RewriteRule ^(.*)$ http://saite.ru/m/ [R=301]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Answer the question
In order to leave comments, you need to log in
If this is a website - make adaptive cross-browser layout and forget about redirects.
If this is a mobile WEB application - do not mix site links and application links: they should be different and unique for each page.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question