14th Sep 2013, 05:24 PM | #1 |
HyperActive Warrior War Room Member Join Date: 2012
Posts: 163
Thanks: 162
Thanked 14 Times in 11 Posts
|
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. |
14th Sep 2013, 08:23 PM | #2 |
HyperActive Warrior War Room Member Join Date: 2012
Posts: 196
Thanks: 486
Thanked 184 Times in 113 Posts
|
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 |
The Following User Says Thank You to PaidAllDay For This Useful Post: |
17th Sep 2013, 08:18 PM | #3 |
HyperActive Warrior War Room Member Join Date: 2012
Posts: 163
Thanks: 162
Thanked 14 Times in 11 Posts
|
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.
|
17th Sep 2013, 08:32 PM | #4 |
HyperActive Warrior War Room Member Join Date: 2012
Posts: 163
Thanks: 162
Thanked 14 Times in 11 Posts
|
I found out how to edit the .htaccess file, but it's still not redirecting. Any ideas?
|
18th Sep 2013, 12:12 AM | #5 |
Mobile Website Designer War Room Member Join Date: 2009
Posts: 529
Thanks: 612
Thanked 119 Times in 95 Posts
|
PM the website details and I'll set you up if you want or I will give you instructions.
|
ARE YOU A CONSULTANT? Do you have clients who could use MORE LEADS? Get them a MOBILE WEBSITE PLATFORM built to stay up with their clients habits. More than 50% of their customers buys from their mobile devices now! CLICK HERE FOR MORE INFO | |
The Following User Says Thank You to Adrian John For This Useful Post: |
20th Sep 2013, 07:28 PM | #6 |
HyperActive Warrior War Room Member Join Date: 2012
Posts: 163
Thanks: 162
Thanked 14 Times in 11 Posts
|
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. |
Bookmarks |
Tags |
client, mobile, redirect, script, site, working |
| |