homepage Welcome to WebmasterWorld Guest from 54.211.201.65
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
htaccess to redirect mobile devices
xname




msg:3614924
 9:19 pm on Mar 30, 2008 (gmt 0)

Hello,
I'm trying to find a way using htaccess to redirect some mobile devices like nokia symbian, iphone to a specific url.

Is it possibile using htaccess?
If yes what's the rewriterule I should use?

Thank you in advance

 

mikhaill




msg:3619357
 6:44 pm on Apr 4, 2008 (gmt 0)

I'd be interested in this too, anyone have any suggestions?

wilderness




msg:3619382
 7:11 pm on Apr 4, 2008 (gmt 0)

Here's a BEGINNING for you to play with.
There will be more options and restrictions required.

You do need to ask yourself some questions?
How are you going to prevent loops and a long list of existing pages that are non-compatible with these phones from being requested?

My own first inclination is to restrict these phones to a specific directory/folder.

Somebody else will need to assist with the above, as well as complicated regex which will catch all pages that are non-phone.!

RewriteCond %{HTTP_USER_AGENT} (nokia¦symbian¦iphone¦blackberry) [NC]
RewriteCond %{REQUEST_URI} !^/Phone\.html$
RewriteRule !^(page4\.html¦page2\.html¦/folder/page1\.html¦OtherFolder/page1\.html)$ [mydomain.com...] [L]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved