I search about mobile direction via htaccess file; and find somethings.. thats ok.. But, i couldnt implement to my recent .htaccess file.. (its not working)
do you have any idea; what should i do?
my recent htaccess file starts with these lines:
Options -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
(i add www line for SEO; to make www.site.com and site.com the same..)
now; iam doing it via php and javascript as like this:
<?
$adres = "http://".$_SERVER['HTTP_HOST']."".$_SERVER['REQUEST_URI']."";
$mobileadres = str_replace("http://www", "http://mobile",$adres);
?>
<script type="text/javascript">
if (screen.width <= 810) {
window.location = "<? echo $mobileadres; ?>";
}
</script>
could you help me to do this via .htaccess file?