Forum Moderators: phranque

Message Too Old, No Replies

from website to mobile site with .htaccess

redirection http .htaccess

         

philippedenormandie

9:11 pm on Jan 4, 2012 (gmt 0)

10+ Year Member



Hello
I submit this little problem that is causing me some worry:
I have a website that I want to create a mobile version, I created the main pages of the site that I loaded via ftp on the www directory of my website (Apache).
I chose a http redirection using a .Htaccess to create a subdomain in the DNS zone on my website (www.normandie44lamemoire.com):
subdomain : normandie44lamemoiremobi
type : CNAME
IP address : www.normandie44lamemoire.com
Below the. Htaccess with the useragent to detect the mobile user and redirect to the mobile version of site:
# Redirect mobile.
RewriteEngine On
RewriteCond% {REQUEST_URI}! ^ / Www.normandie44lamemoire.com/. * $
RewriteCond% {HTTP_USER_AGENT} "ipod | iphone | IPAD | samsung | nokia | htc | Blackberry | Sony | android | symbian" [NC, OR]
RewriteRule ^(.*)$ normandie44lamemoiremobi [R = 302, L]
I downloaded the file .Htaccess in the www directory (with FileZilla), and it does not work, I think my syntax is faulty, or something ...
Thank you in advance (from France)

lucy24

12:14 am on Jan 5, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is that an exact cut-and-paste of your htaccess, with spaces as shown? And is the actual file called .htaccess with exactly that punctuation and capitalization? Apache is very unforgiving; it's not like html and css which are explicitly designed to handle errors and carry on.