leoric Posted March 5, 2014 Share Posted March 5, 2014 hi,everyone. today i have a question need help. this is my application background story: my site domain is abc.com and i need a mobile website use m.abc.com (this is a seo suggestion from baidu.com ) they are connect to same database , just have their own difference template. is anyone have any idea? thanks. Link to comment Share on other sites More sharing options...
cstevensjr Posted March 5, 2014 Share Posted March 5, 2014 While that's one way of dealing with a mobile site, the other way would be to use a mobile-first front end framework (such as Bootstrap 3 or Zurb Foundation 4/5) and develop your site at your abc.com domain. I would be very interested to know why Baidu thinks (for SEO purposes) that the separate mobile site is better than a consolidated website (mobile and responsive) at the same domain. 4 Link to comment Share on other sites More sharing options...
Marty Walker Posted March 5, 2014 Share Posted March 5, 2014 Media queries are your best bet. If you need to rearrange elements based on device you could try using http://intentionjs.com/ 1 Link to comment Share on other sites More sharing options...
leoric Posted March 5, 2014 Author Share Posted March 5, 2014 While that's one way of dealing with a mobile site, the other way would be to use a mobile-first front end framework (such as Bootstrap 3 or Zurb Foundation 4/5) and develop your site at your abc.com domain. I would be very interested to know why Baidu thinks (for SEO purposes) that the separate mobile site is better than a consolidated website (mobile and responsive) at the same domain. hi, cstevensjr and Marty Walker thank you for your reply i have been think so before,i even think its unreasonable. but in the fact it done. baidu highly recommended webmaster build mobile website. and them made a tool to online building mobile site (siteapp.baidu.com) unfortunately our chinese language website have a large proportion of traffic from baidu search. so we have to comply with official seo suggestion. i think baidu have two independent systems(pc and mobile). i do this if there have a good solution. Link to comment Share on other sites More sharing options...
Raymond Geerts Posted March 5, 2014 Share Posted March 5, 2014 Another approach would be to have a duplicate of your template folder where you use diffferent code inside your templates. I use this a lot for development in a live site, but its an easy solution to use it for a mobile website too. When your normal site is finished (or while developing) make a duplicate of the template folder and name it "templates-mobile". The goal here is to have exactly the same template files in both folders. Paste the following code at the bottom of the /site/config.php file and change the m.domain.ext to your needs if($_SERVER['HTTP_HOST'] == 'm.domain.ext') { $config->urls->templates = '/site/templates-mobile/'; $config->paths->templates = $rootPath . $config->urls->templates; } This way when you visit your website on m.domain.ext it will use the templates out of the templates-mobile folder while it still uses the same data from the database, assets folder and the modules. 10 Link to comment Share on other sites More sharing options...
geniestreiche Posted March 5, 2014 Share Posted March 5, 2014 a more feature rich solution: http://mobiledetect.net 4 Link to comment Share on other sites More sharing options...
diogo Posted March 5, 2014 Share Posted March 5, 2014 If all you want is to comply to baidu suggestion, just make a responsive site in abc.ext and point m.abc.ext to it like you probably did with www.abc.ext 4 Link to comment Share on other sites More sharing options...
leoric Posted March 6, 2014 Author Share Posted March 6, 2014 Another approach would be to have a duplicate of your template folder where you use diffferent code inside your templates. I use this a lot for development in a live site, but its an easy solution to use it for a mobile website too. When your normal site is finished (or while developing) make a duplicate of the template folder and name it "templates-mobile". The goal here is to have exactly the same template files in both folders. Paste the following code at the bottom of the /site/config.php file and change the m.domain.ext to your needs if($_SERVER['HTTP_HOST'] == 'm.domain.ext') { $config->urls->templates = '/site/templates-mobile/'; $config->paths->templates = $rootPath . $config->urls->templates; } This way when you visit your website on m.domain.ext it will use the templates out of the templates-mobile folder while it still uses the same data from the database, assets folder and the modules. Raymond Geerts,you are a great help. thank you! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now