Slimster Posted April 29, 2011 Share Posted April 29, 2011 Hoping someone can help me i know very little about php anyways i am trying to get this to work on my eccommerce site which is all in php. Here is the instructions i have i did upload the files all i need help with is where to put the single line of code for the redirect. Installation 1. Create a subdomain on your server called 'm'. (Ex: m.example.com) * Depending on what kind of hosting you have, the procedure to do this may be either editing configuration files and restarting the server, accessing a control panel, or having a system administrator set it up. 2. Upload the files from the 'm' directory to the document root for your new subdomain. 3. Your mobile site is working! Just visit your m subdomain to see it. Setting up auto redirect If your website is in PHP, you can use phpMobilizer to set up automatic redirection to your mobile site for mobile devices. 1. First you will need to determine where to place the redirect code. Usually you would want to place it in a common include file, such as a config file, a database connection file or a header file. 2. Add the following line of code before any html or text output. * require_once('/home/path/to/subdomain/m/mobilize.php'); * Edit the path so it is pointing directly to the mobilize.php file, which will be in the subdomain's document root. 3. Visit your website with a mobile device and verify it redirects you! Quote Link to comment https://forums.phpfreaks.com/topic/235122-need-help-with-a-redirect-for-mobile/ Share on other sites More sharing options...
trq Posted April 30, 2011 Share Posted April 30, 2011 Um... the instructions look pretty clear to me. What exactly is your issue? Quote Link to comment https://forums.phpfreaks.com/topic/235122-need-help-with-a-redirect-for-mobile/#findComment-1208521 Share on other sites More sharing options...
Slimster Posted April 30, 2011 Author Share Posted April 30, 2011 My problem is i do not know where to put the line of code on my site i tried it on the header.php and a few other pages but it keeps showing the code on top of my site when i open it in a browser. Now should it be put on top before everything and should it be in php tags. Quote Link to comment https://forums.phpfreaks.com/topic/235122-need-help-with-a-redirect-for-mobile/#findComment-1208603 Share on other sites More sharing options...
trq Posted May 1, 2011 Share Posted May 1, 2011 Of course it has to be within php tags, it's php code. Quote Link to comment https://forums.phpfreaks.com/topic/235122-need-help-with-a-redirect-for-mobile/#findComment-1208875 Share on other sites More sharing options...
Slimster Posted May 1, 2011 Author Share Posted May 1, 2011 I kind of thought so so i put it on my header.php page at the top now the page shows up correctly on mobile with no code showing on page so i guess it is working. Quote Link to comment https://forums.phpfreaks.com/topic/235122-need-help-with-a-redirect-for-mobile/#findComment-1209157 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.