0
Hello, everybody!
I have a question regarding my HTACCESS file. I happen to have a site in two versions, common and mobile. In the folder of the mobile file, there is the file . htaccess that receives the following code:
RewriteCond %{HTTP_USER_AGENT} !(android|blackberry|ipad|iphone|ipod|iemobile|opera\ mobile|palmos|webos|googlebot-mobile) [NC]
RewriteRule ^$ http://www.meusite.com.br/ [L,R=302]
This way, when trying to access the link "http://meusite.com.br/mobile" through a desktop, for example, it is directed to the main url.
So far so good.
The problem is in the reverse. In the root folder of the site, in the file . htaccess put as follows:
RewriteCond %{HTTP_USER_AGENT} (android|blackberry|ipad|iphone|ipod|iemobile|opera\ mobile|palmos|webos|googlebot-mobile) [NC]
RewriteRule ^$ http://www.meusite.com.br/mobile [L,R=302]
With this, the user when trying to access the main link through a mobile, should be directed to the mobile directory, but is not working.
Is there an error in this file?
Abçs
Hello Jasar, I did as you suggested. When opening the default url through a mobile, it worked perfectly, redirecting to the mobile version. The problem is that when testing on the desktop, it also directs to mobile.
– Eduardo
strange just tested here and ta normal. vc tested with which browsers?
– Jasar Orion