Can Someone Help Me With .htaccess Please
I'm trying to add a mobile version to an old web site. I found the following instructions on how to switch the user to the mobile site if they are using a mobile (it's not a wordpress site, just simple HTML)
RewriteEngine On
# Check for mime types commonly accepted by mobile devices
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ http://m.domain.com%{REQUEST_URI} [R,L]
The mobile version of my site is in http://www.domain.com/mobile_site/ so the final line in my case is
RewriteRule ^ http://www.domain.com/mobile_site/%{REQUEST_URI} [R,L]
It doesn't seem to work...have I got it wrong ?
Thanks
Comments
All I really want to know is have I got the "RewriteRule" line correct, I want it to redirect
http://www.domain.com/page1.html to http://www.domain.com/mobile_site/page1.html
http://www.domain.com/page2.html to http://www.domain.com/mobile_site/page2.html
http://www.domain.com/page9.html to http://www.domain.com/mobile_site/page9.html etc when it thinks it's found a mobile browser
Does that look right ??
Did you put this code at the top of .htaccess file?