<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# prevent looping
RewriteCond %{HTTP_HOST} !^m\.webhaanh\.com
# Check if mobile=1 is set and set cookie 'mobile' equal to 1
RewriteCond %{QUERY_STRING} (^|&)mobile=1(&|$)
RewriteRule ^ - [CO=mobile:1:%{HTTP_HOST}]
# Check if mobile=0 is set and set cookie 'mobile' equal to 0
RewriteCond %{QUERY_STRING} (^|&)mobile=0(&|$)
RewriteRule ^ - [CO=mobile:0:%{HTTP_HOST}]
# cookie can't be set and read in the same request so check
RewriteCond %{QUERY_STRING} (^|&)mobile=0(&|$)
RewriteRule ^ - [S=1]
# Check if this looks like a mobile device
RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC,OR]
RewriteCond %{HTTP:Profile} !^$
# Check if we're not already on the mobile site
RewriteCond %{HTTP_HOST} !^m\.
# Check to make sure we haven't set the cookie before
RewriteCond %{HTTP:Cookie} !\mobile=0(;|$)
# Now redirect to the mobile site
RewriteRule ^(.*)$ http://m.webhaanh.com/$1 [R=301,L]
</IfModule>
# BEGIN WordPress - chuyển tất cả các link về webgiare.vn
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^m.$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /default.asp [L]
</IfModule>
# END WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).htm$ home/detail_ceo.asp?idata=$1 [L]
RewriteRule ^(.*)/(.*).htmt$ home/type_tintuc_ceo.asp?icat=$2&ichannel=$1 [L]
RewriteRule ^(.*)/(.*).html$ home/type_ceo.asp?icat=$2&ichannel=$1 [L]
RewriteRule ^(.*).html$ home/channel_ceo.asp?ichannel=$1 [L]
RewriteRule ^(.*).htmt$ home/channel_tintuc_ceo.asp?ichannel=$1 [L]
RewriteRule ^(.*).stm$ home/newsdetail_ceo.asp?idata=$1 [L]
RewriteRule ^(.*).xtm$ home/home_ceo.asp?idata=$1 [L]
</IfModule>