Jump to content

Best way to redirect users to mobile version?


Recommended Posts

I've written a separate version of my website http://www.bertcoules.co.uk for mobile users, but I'm puzzled as to the best way to automatically direct people there. I've found several methods online but, as ever, it's not easy to know which is preferred by modern practice.

 

I have tested this:

 

 

<script type="text/javascript"><!--if (screen.width <= 699) {document.location = "mobile.html";}//--></script>

 

which works on my Android phone and tablet and is nicely simple. If it's acceptable and universal, I'll stick with that. But is it?

 

The mobile site files will be housed on my co.uk domain and are in fact currently available at http://www.bertcoules.co.uk/test/ .

 

Many thanks.

Edited by Bert Coules
Link to post
Share on other sites

Hi Bert,

 

Have you tried using css @media queries, instead of a different document, to restyle the page based on the queries made by the css?

 

In all honesty, I'm not sure which of the two methods (document redirection or using @media queries) is considered best practice. But, I started playing with css @media queries recently and I'm quite pleased with the results.

Edited by deldalton
Link to post
Share on other sites

Thanks for the replies. I considered that approach, but having just redesigned the whole of my site and being reasonably pleased with the result, I decided against it. Dsonesuk, why is it seen as better to have just one site which adjusts to different screen widths? Beyond not having to update two sites rather than one, where exactly is the advantage?

Edited by Bert Coules
Link to post
Share on other sites

Dsonesuk, why is it seen as better to have just one site which adjusts to different screen widths? Beyond not having to update two sites rather than one, where exactly is the advantage?

 

Besides the advantage you've already mentioned (having fewer files to update) I suspect it's because your browser then has fewer files to download, which is always a benefit.

Edited by deldalton
Link to post
Share on other sites

Del, Dsonesuk, thanks for your replies. The site is essentially static, so the very occasional update shouldn't cause much in the way of a hassle.

 

Both sites (or both versions of the same site) will be part of the same domain, with the mobile files nesting in a subdirectory and the images shared, but there will inevitably be some degree of duplication. Perhaps it could be minimised slightly and made more acceptable to Google's automated trawlers by only having the meta description material in the main site files? On the other hand, I believe I could live with the mild disapproval of a multinational multi-million pound corporation.

 

Having said that, I have a second site which I'd like to make mobile-friendly too, so with that I might well try the other approach. The challenge of redesigning it to be adaptable while still looking good at various screen widths will be an interesting one.

Edited by Bert Coules
Link to post
Share on other sites

Search engines are the primary way that people find websites. It's not that there's some person at Google that doesn't like your site, but that your site will be further down in search results. Statistics have shown that a majority of people searching never look beyond the first page of results. If your business has a dependency on this website, you likely will want to make sure the website is as easy to find as possible.

Link to post
Share on other sites

Ingolme, thanks for that. I wasn't really imagining some irate Google employee fuming at my online efforts, gratifying though that would be.At the moment, anyone searching for my name will find my site listed as the first Google result, followed by my Wikipedia entry, which itself has a link to the site. Related searches for various areas of my work generate results that are almost as good. Is that likely to change if I include the files for the mobile version in a subdirectory?

Edited by Bert Coules
Link to post
Share on other sites

There probably is not a lot of competition for using your name as a keyword, so I don't think you have to worry about that. But if you want to rank high for keywords like "BBC writer" or "Drama writer" you have much more competition.

Link to post
Share on other sites

That's true enough, but it's hard to imagine any strategy that might improve my chances in searches that vague, and however devious I might be I doubt if the possibility of my name ending up on the first page would be any better than nil.

 

I can live with that, though. My sites are more about giving information to people who already know they're there than they are about bringing in new work.

Edited by Bert Coules
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...