mobile redirect script not working for client's site I had someone make mobile sites for clients, but one of them is not redirecting. The rest of them are. I used the same code for all of them. Its a regular javascript code based on screen width: <script type="text/javascript"> if(window.location.hash != '#r=off') { if (screen.width <= 1023) { document.location = "http://m.mysite.com"; } } </script> If I go to the mobile site directly (i.e. I type in m.mysite.com) into the url, the mobile site works fine. Its not the script because I am using the script for other sites. The guy I hired to make them stopped replying to me, so I am not sure what is wrong. I don't know too much about coding but have edited code before so can follow instructions. It's just weird that the problem is only with this site. |
Re: mobile redirect script not working for client's site Mobile redirects really should be done through .htaccess not javascript. Especially given that not all mobile browsers support javascript. Take a look at something like this: NingNing Wang: How to redirect to mobile site using htaccess |
Re: mobile redirect script not working for client's site Thanks. I don't do much coding, so I cannot find the htaccess file. Where can I find the .htaccess file? I only see the index and the different pages in the root directory. |
Re: mobile redirect script not working for client's site I found out how to edit the .htaccess file, but it's still not redirecting. Any ideas? |
Re: mobile redirect script not working for client's site PM the website details and I'll set you up if you want :) or I will give you instructions. |
Re: mobile redirect script not working for client's site Thanks Adrian, For the record, I PMd Adrian the details, and now its fixed. See the timing of the posts yourself. He actually fixed it over 5 hours ago. |
All times are GMT -6. The time now is 04:20 AM. |