C
C
cepgej2014-12-22 18:06:13
HTML
cepgej, 2014-12-22 18:06:13

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

2 answer(s)
K
keslo, 2014-12-22
@keslo

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 :-)

M
Max, 2017-05-10
@MaxDukov

you don't have mysql installed. Actually, the system writes to you about this. And even suggests that you can do
apt-get install <package name>. Just putting a client, something tells me, won't be enough. =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question