Convert websites for mobile devices

hello guys,

im trying to convert my website for mobile devices that are using, for example, iOS or Android. i found while i was searching for a solution, and this service seems to be pretty much ok. now, before ill decide what ill do,can you tell me something better?

tnx. :slight_smile:

Why do you need to “convert” your site at all? A well-written site will be perfectly usable on a mobile phone browser. If you can give us some clues as to why your site in particular needs this conversion, we might be able to help you fix it so that it doesn’t need it!

my site, well its a blog, needs zoom in or out to fits on a iPhone for example, and this is not ok at all for my readers. So, i want to optimize my site’s theme in order to be easy to read from smartphones or tablets.

If you resize your browser while looking at the site you linked to, you’ll see that it changes shape dramatically based on browser width. This is done with CSS media queries. E.g.

@media screen and (max-device-width: 480px) {
  … styles for small screens here

They mainly work on fancy devices like the iPhone at this stage, but that’s a start.

Another method is to offer up very simple styles for all browsers, and then a nicer set of styles for browsers that can understand them via media queries as above.

Rethinking the Mobile Web by Yiibu

I recently made a mobile version of my site. I think Stevie might be right though. You may not need to convert it, but I think it’s a good skill to learn anyway.

What I did was made a new site basically, but in the CSS used, I set the width to 340px which works on most hand-held devices I believe (tried my Android, my dads BlackBerry, and my PSP). I then created a subdomain ( for my redirects to go to. You’ll have to make sure that your mobile site is labeled something like “index” like your homepage in your mobile folder that you’ll probably be creating. Finally, I used a PHP script to redirect these devices that I found.

If this idea sounds good to you, I’ll have the PHP script posted below if you need it:


if(checkmobile()) header('Location:');

function checkmobile() {

    if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) return true;
    if (false !== stripos($_SERVER['HTTP_ACCEPT'], 'wap')) return true;

    $reject = array(
        'Creative AutoUpdate',
    $accept = array(
        'windows ce',
    $accept_regex = array(

    if (isset($_SERVER['HTTP_USER_AGENT'])) {
        // check for definite rejects
        foreach ($reject as $string) {
            if (false !== stripos($_SERVER['HTTP_USER_AGENT'], $string)) {
                return false;
        // more efficient accept check
        foreach ($accept as $string) {
            if (false !== stripos($_SERVER['HTTP_USER_AGENT'], $string)) {
                return true;
        // use regex only where necessary
        foreach ($accept_regex as $string) {
            if (preg_match('/'.$string.'/i', $_SERVER['HTTP_USER_AGENT'])) {
                return true;

    return false;



Some sites look good on the PSP though, so feel free to remove it.

I’m not a php programmer so this looked like just what was needed to redirect my users to the mobile version of the site. I copied Louie’s code to a test index page and looked at it on my Android phone. It does not show this [URL=“”]mobile version of the page. Can someone point out what I’m missing? BTW, my client wants the simpler mobile version rather than the full website for the market he is targeting.