Forums / General Questions / httaccess redirect to mobile addon domain

httaccess redirect to mobile addon domain

Views: 551

Results 1 to 1 of 1
18 Feb 2015, 7:44 PM
#1
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

httaccess redirect to mobile addon domain

I am looking to redirect any page from my zencart to an addon domain suchas mobi.myzencart.com

I added this to my htaccess file in the website root directory.

RewriteEngine On
RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
RewriteRule ^$ [URL="http://mobi.lakeservers.com"]http://mobi.mywebsite.com[/URL] [L,R=302]

It works wonderul for the main page of my website, but does nothing for any other page. I even added it to the htaccess file for the directory where zencart is installed, and still no luck.

Apart from adding javascript to the head file, is there some other way using htaccess?

Thanks

ZC v1.5.7 "I was so much older then...I'm younger than that now" Cut the umbilical cord with webhosts after 20 years. FREEDOM!