Empire CMS Mobile version maker + Empire PC jump to Phone + redirect

Source: Internet
Author: User

Learning Links:

The Empire CMS7.2 version multi-terminal access feature using the Graphics tutorial:http://bbs.phome.net/showthread-13-329096-0.html

Empire CMS PC station URL jump to the URL of the phone station the original address:http://www.zzarea.com/cms/diguocms/2153.html

. htaccess tips: URL rewriting (Rewrite) and redirection (Redirect): http://blog.csdn.net/newjueqi/article/details/12014673

Empire Mobile phone Access production steps:


One, set all access to the unified access address;

System--System settings--System parameter settings--Basic properties--Modify the attachment address as the WAP end address

Second, the new Access end used template group;

Template--Template group Management--Import/Export Template group--Import template Group--Browse--Create New template group--Import--template group name--Modify

Third, create a new access directory, and copy an Imperial CMS program file in;

Upload to the root directory (note: Do not build subdirectories in the home directory, be careful to set the directory permissions.) )

Iv. binding a two-level domain name to the new access-side directory;

Resolve Domain Name: m.******.com
Bind domain name: to host

Five, to the main access terminal backstage added "website Access";

System--Website multi-access--Manage website multi-access side--increase the access side--:
Name: Mobile Access Terminal
Address: http://m.qyhongyan.com/(or Direct use path: http://www.qyhongyan.com/sjbb/)
Catalog:/home/u1025/ace/workspace/php/appcode/webroot/htdocs/sjbb/
Key:--Randomly generated
Using the template: Mobile
Page mode: Force dynamic
Close Submissions
Submit

--Update the access-side cache

Vi. Modify the configuration file parameters to the new access-side directory;

Modifying a configuration file--/sjbb/e/config/config.php

Fill in the template group ID used on this access side, and the site's access ID. For example, instead:
The phone template ID is 2, the access end phone ID is 2
$ecms _config[' sets ' [' Deftempid ']=2;
$ecms _config[' sets ' [' Selfmoreportid ']=2;

Seven, complete.

In the public template to give a code to jump to the mobile phone access: (or directly to the homepage, according to their own needs, suggest only to the homepage)
<script type= "Text/javascript" >
try {var urlhash = window.location.hash;if (!urlhash.match ("Fromapp"))
{if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)))
{window.location= "http://www.qyhongyan.com/sjbb/";}}}
catch (Err)
{
}</script>
<meta name= "mobile-agent" content= "format=xhtml;url=http://www.qyhongyan.com/sjbb/" >

Method One: Empire PC Station jump to mobile phone static station

1, suppose we have the Imperial CMS computer website www.zzarea.com, mobile website m.zzarea.com, mobile website uses the Imperial CMS's multi-access function production. Now the computer and mobile phones are all generating static sites, except for domain names, static connection addresses are the same, for example:
Www.zzarea.com/china/1.html Correspondence m.zzarea.com/china/1.html

2, next to the Computer Site homepage, list page, content page template add jump code, the method is as follows:
JS is a browser jump, meta is to tell the search engine mobile page address.

(1) The first page template should add the following code
<script type= "Text/javascript" >
try {var urlhash = window.location.hash;if (!urlhash.match ("Fromapp"))
{if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)))
{window.location= "http://m.zzarea.com/";}}}
catch (Err)
{
}</script>
<meta name= "mobile-agent" content= "format=xhtml;url=http://m.zzarea.com/" >

(2) Add the following code to the cover page and List page
<script type= "Text/javascript" >
try {var urlhash = window.location.hash;if (!urlhash.match ("Fromapp"))
{if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)))
{window.location= "http://m.zzarea.com<?=sys_ReturnBqClassUrl ($class _r[$GLOBALS [Navclassid]]);? > ";}}}
catch (Err)
{
}</script>
<meta name= "mobile-agent" content= "Format=xhtml;url=http://m.zzarea.com<?=sys_returnbqclassurl ($class _r[$ GLOBALS[NAVCLASSID]);? > ">

(3) Add the following code to the content page
<script type= "Text/javascript" >
try {var urlhash = window.location.hash;if (!urlhash.match ("Fromapp"))
{if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)))
{window.location= "http://m.zzarea.com[!--titleurl--]";}}}
catch (Err)
{
}</script>
<meta name= "mobile-agent" content= "format=xhtml;url=http://m.zzarea.com[!--titleurl--]" >

After adding the above code, each page of the Empire CMS computer site can be redirected to the mobile phone's static website.

But the mobile phone static station is flawed, every time we update the computer-side article, we have to go to the background of the mobile phone to regenerate HTML, more trouble, so we can set up the mobile phone station dynamic access, the next step to explain the computer to jump mobile phone dynamic station method.

method two: The Imperial CMS Computer website jumps to the mobile phone dynamic station method
1, first in the computer side of the multi-access settings, the mobile phone terminal is set to force dynamic page mode. So the mobile station is dynamic, do not have to generate HTML every time.
2, Next is to the computer-side template of the first page, List page, content page to add dependent jump code, and method a similar.
JS is a browser jump, meta is to tell the search engine mobile page address.
(1) The first page template needs to add the following code
<script type= "Text/javascript";
try {var urlhash = window.location.hash;if (! Urlhash.match ("Fromapp"))
{if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)))
{window.location= "http://m.zzarea.com/";}}}
catch (Err)
{
}</script>
<meta name= "mobile-agent" content= "format=xhtml;url=http:// m.zzarea.com/";

(2) Add the following code to the cover page and List page
<script type= "Text/javascript" >
try {var urlhash = window.location.hash;if (!urlhash.match ("Fromapp"))
{if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)))
{window.location= "http://m.zzarea.com/e/action/listinfo/?classid=[!--self.classid--]";}}}
catch (Err)
{
}</script>
<meta name= "mobile-agent" content= "format=xhtml;url=http://m.zzarea.com/e/action/listinfo/?classid=[!-- self.classid--] ">

(3) Add the following code to the content page
<script type= "Text/javascript" >
try {var urlhash = window.location.hash;if (!urlhash.match ("Fromapp"))
{if (Navigator.userAgent.match (/(iphone|ipod| Android|ios|ipad)))
{window.location= "http://m.zzarea.com/e/action/showinfo.php?classid=[!--classid--]&id=[!--id--]";}}
catch (Err)
{
}</script>
<meta name= "mobile-agent" content= "format=xhtml;url=http://m.zzarea.com/e/action/showinfo.php?classid=[!-- classid--]&id=[!--id--] ">

Add the above code, the PC website can jump to the mobile phone side of the corresponding page.
Note: When using the above code, change the domain name in the code to your own domain name.
Original address: http://www.zzarea.com/cms/diguocms/2153.html

REDIRECT applies to: M.****.com

The code is as follows: File suffix--. htaccess

<ifmodule mod_rewrite.c>
Rewriteengine on
Rewritebase/
Rewritecond%{http_host} ^m.qyhongyan.com$ [NC]
Rewritecond%{request_uri}!^/sjbb/
Rewriterule ^ (. *) $ sjbb/$1? Rewrite [L,QSA]
</IfModule>

Empire CMS Mobile version maker + Empire PC jump to Phone + redirect

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.