Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 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
Default
mobile redirect script not working for client's site
Share on: 
fb share twitter share gplus share more share

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.
stranger11 is offline  
Unread 14th Sep 2013, 08:23 PM   #2
HyperActive Warrior
War Room Member
 
PaidAllDay's Avatar
 
Join Date: 2012
Posts: 196
Thanks: 486
Thanked 184 Times in 113 Posts
Default
Re: mobile redirect script not working for client's site
Share on: 
fb share twitter share gplus share more share

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
PaidAllDay is offline  
The Following User Says Thank You to PaidAllDay For This Useful Post:
Unread 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
Default
Re: mobile redirect script not working for client's site
Share on: 
fb share twitter share gplus share more share

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.
stranger11 is offline  
Unread 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
Default
Re: mobile redirect script not working for client's site
Share on: 
fb share twitter share gplus share more share

I found out how to edit the .htaccess file, but it's still not redirecting. Any ideas?
stranger11 is offline  
Unread 18th Sep 2013, 12:12 AM   #5
Mobile Website Designer
War Room Member
 
Adrian John's Avatar
 
Join Date: 2009
Posts: 529
Thanks: 611
Thanked 119 Times in 95 Posts
Default
Re: mobile redirect script not working for client's site
Share on: 
fb share twitter share gplus share more share

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
Adrian John is offline  
The Following User Says Thank You to Adrian John For This Useful Post:
Unread 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
Default
Re: mobile redirect script not working for client's site
Share on: 
fb share twitter share gplus share more share

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.
stranger11 is offline  
Closed Thread


Bookmarks

Tags
client, mobile, redirect, script, site, working


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:47 AM.