htaccess detect mobile and redirection with cookie

I need a code in my htaccess that do this:

1) Detect mobile browser and redirect, like this:

if is mobile, redirect from [url removed, login to view] to [url removed, login to view]

or [url removed, login to view] to [url removed, login to view]

Always redirect to home, I don't need equivalent urls.

Actually I do this with this code:

RewriteCond %{REQUEST_URI} !^/m/.*$

RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]

RewriteRule ^(.*)$ /m/ [L,R=302]

2) But, I also need a url that go from mobile version to normal site, and this not possible with the code that I use. Because always redirect to mobile version.

It's possible do theses two things only with htacces?

If there is other way , welcome.


3) Finally, you must tell me where put the code (if we use another way to htaccess). I will use code in html website and joomla website.

Taidot: PHP

Näytä lisää: htaccess redirect cookie mobile, htaccess detect mobile, www t, www t mobile com, where's my android, t mobile android, t . mobile, opera android, m mobile site, mobile redirection cookie, webOS, theses, joomla android, htaccess, go mobile, detect mobile, mobile html redirect code, detect php, browser detect, cookie htaccess, detect browser redirect, html mobile redirect code, redirect htacces, website browser mobile, php htaccess

Tietoa työnantajasta:
( 2 arvostelua ) Chillán, Chile

Projektin tunnus: #1698291

Myönnetty käyttäjälle:


can do it with alternate method. check pm

$30 USD 1 päivässä
(0 Arvostelua)

3 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön


Hi, I am sending you a message in a sec. Kind Regards

$30 USD 0 päivässä
(257 arvostelua)

Professional web developer is ready get started right now. Please read my private message for more information.

$30 USD 2 päivässä
(87 arvostelua)

Hi, I sent a pm.

$30 USD 1 päivässä
(43 arvostelua)