Problem with mobile redirect - sometimes dont want to

microscope

New Member
Hi guys I'm new here :) Starting out with a problem I have too. I have a website and I found some code online which makes it redirect to a mobile version of the site. This all works great.

My problem is that some people want to view the none mobile version on their mobiles. I have a link to the desktop version of the site on the mobile pages, but of course it just keeps redirecting them back to the mobile site.

I have not much idea what the solution would be to this, hoping you guys could help? My only ideas were to either get rid of the redirect and make people go to a 'landing' page and have to choose which version of the site they want. Or, to have a total duplicate of the site with the redirect code missing and have the link on the mobile site send people there. But neither solution is ideal.

Thanks in advance :)
 

Phreaddee

Super Moderator
Staff member
hmmm, mobile redirects.
I personally think there are better ways to accomplish mobile sites. like responsive design via media queries.

thats your answer.
 

microscope

New Member
That sounds a bit complex for me, I'm not a professional so just need an easy solution. I was thinking about maybe just having a mobile button on the main website and people can use that, but the redirect was quite slick and it would be a shame to see that go. Also it's not just the layout that changes, but a lot of the content is simplified on the mobile site.
 
Last edited:

Phreaddee

Super Moderator
Staff member
Code:
@media all and (max-width:600px) {/*add styles for mobile here*/}
@media all and (min-width:601px) {/*add styles for desktop here*/}

obviously thats simplified to the extreme. but its really that simple.

dont be hiding stuff because you "think" a mobile user doesnt want that on the site.
thats the wrong way to go about it. dont ever assume what a mobile user wants or needs. if they are wanting to visit the desktop site, it is because you've hidden or removed content that obviously they want to see on their mobile. is that not enough of a hint to tell you that you've got their needs wrong?

once you've used media queries you'll soon realise that you wont miss the "slickness" of the redirect.
 

che09

New Member
hmmm, mobile redirects.
I personally think there are better ways to accomplish mobile sites. like responsive design via media queries.

thats your answer.

I also think this way. Look for better ways to accomplish mobile sites.
 

Roddy

New Member
Mobile Redirects

About 90% of the work that I do is responsive designs. Having said that, I have clients who have a conventional website and don't want to pay for a complete new design.

All they want is a cut down version of their main site that will work on smart phones and most of them want a link so that the mobile visitor can go to the main site if they choose.

I guess you could tell them to piss off and come back when they have more money to spend but you could also consider this way...

Change your landing page name from index.html to home.html or whatever.

Create an index.html file that is a redirect to the Home page and add the mobile redirect code to this.

Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Redirect</title>
<meta http-equiv="refresh" content="0;url= Home.html" />
<script type="text/javascript">
<!--
if (screen.width <= 600) {
window.location = "http://mobile.domain-name.com"; }
//-->
</script></head><body></body></html>

This will direct those with PCs and wider tablets to the Home page and those who are using devices with screens of 600px or less will get to the mobile version. Change the screen width to anything you want.

Now the link from the mobile site can be directed to the Home.html of the main site and bypasses the index.html redirect.
 

leroy30

New Member
First time they hit the site from a mobile device send them to the mobile version. Provide a link or button to revert back to the regular version. Save a cookie to persist the selection.
 
Top