Hello,
I have a problem when I edit the file .htaccess
I want put redirection for website mobile.
The code I put in .htaccess for mobile:
(RewriteCond %{HTTP_USER_AGENT} « ipod|iphone|ipad|android|palm|googlebot-mobile » [NC]
RewriteRule (.*) http://www.gicour.byethost14.com [R=301,L]
Someone can tell me if I have an error?
Thx
Yes the URL is another host or do you know that?
1 Like
yes I know Infinity. it’s a problem?
No problem no.
Try this code.
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteRule ^$ http://james2.000webhostapp.com/ [L,R=302]
Put it above the code that will already be in your .htaccess file such as
[code]# HTID:609548: DO NOT REMOVE OR MODIFY THIS LINE AND THE LINES BELOW
php_value display_errors 1
DO NOT REMOVE OR MODIFY THIS LINE AND THE LINES ABOVE HTID:609548:[/code]
If you test http://james222.000webhostapp.com it will load this on desktops
But on mobile it redirects successfully to james2.000webhostapp.com
1 Like