Image redirect for mobile version

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 03 Oct 2012, 04:46

Image redirect for mobile version

03 Oct 2012, 04:51

hi, i want redirect all request for the image in mysite, like this domain.com/public/normal/img.jpg to domain.com/public/mobile/img.jpg , if the request come form a mobile device.

I have inserted an .htaccess file in /public/ path with this code:

Code: Select all
RewriteEngine on
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]
RewriteRule ^public/normal/(.*)$ public/mobile/$1 [R=301,L]


but it not work.

Any ideas?

Thanks

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Image redirect for mobile version

03 Oct 2012, 23:30

hello,

Have you tried using User-Agent variable instead, as described in examples section?

Regards
Andrew

User avatar
Posts: 2
Joined: 03 Oct 2012, 04:46

Re: Image redirect for mobile version

04 Oct 2012, 07:26

Thanks, i have found a tool online with the lists of user-agent for mobile. This is the link http://detectmobilebrowsers.com/

User avatar
Posts: 24
Joined: 27 Nov 2012, 21:57

Re: Image redirect for mobile version

28 Nov 2012, 22:49

Does this tool really help? I don't know where to start.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests