View Single Post
Old 04-24-2017, 12:50 PM  
alastik
Registered User
 
alastik's Avatar
 
Industry Role:
Join Date: Mar 2017
Location: Ohio
Posts: 50
This code in your .htaccess will redirect based on the MIME types the user's browser supports.

Code:
RewriteEngine On
# Mobile check
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ your domain full url%{REQUEST_URI} [R,L]
Note - This requires mod_rewrite to be enabled on your server.

Quote:
And what's the correct htaccess way to drive mobile traffic on a domain to a specific page?
A simple 301 Redirect should do the trick and should not piss off Google.

Code:
redirect 301 oldpageurl (eg - /directory/file.html/php/whatever) 
httpfullurlofnewpage
alastik is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote