Answer the question
In order to leave comments, you need to log in
What is the correct way in my case to set a redirect to the mobile version of the site using htaccess?
There is a directory with a site. It contains two subdirectories - desktop and mobile. They contain index.php, custom js, css and images for the desktop and mobile versions of the site, respectively. At the root of the site are js, css and pictures used in both versions.
The question is as follows. How can I ensure the correct operation of my site, so that in the case of the desktop version, the user would go to the address mysite.ru (index.php would be loaded from the desktop subfolder), and in the case of the mobile version, to m.mysite.ru (the index would be loaded) .php from the mobile subfolder). htaccess is used. hosting timeweb.
Answer the question
In order to leave comments, you need to log in
I use this script - mobiledetect.net. I simply add forced redirects for the corresponding devices to the script.
Although of course not quite through htaccess :-)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question