PHPCMS WAP Mobile Station pseudo static method Nginx

Source: Internet
Author: User

Phpcms Open Pseudo-static method is very simple, on-line tutorials especially. First, the mobile version of the domain binding to space, and then in the Phpcms module inside the background to open the mobile phone portal, the mobile domain name to fill in
Open/phpcms/modules/wap/functions/global.func.php
Find the two functions inside and comment out the code shown in the Red section, adding the code below the comment.

function list_url ($typeid)  {      #return  wap_siteurl. " &a=lists&typeid= $typeid ";    return "/list-$typeid ". HTML ';} Function show_url ($catid,  $id,  $typeid = ")  {global  $WAP; if ($typeid = =")  {    $types  = getcache (' Wap_type ', ' WAP ');  foreach  ($types  as  $type)   {   if ($type [' Cat ']== $catid)  {     $typeid  =  $type [' typeid '];     break;   }  }}       #return  wap_siteurl. " &a=show&catid= $catid &typeid= $typeid &id= $id ";     return   "/show-$catid-$typeid-$id". HTML ';} 



add pseudo-static rules, here I use the Nginx rules, if you use different, please control the changes.

rewrite ^/list-([0-9]+) .html/index.php?&a=lists&typeid=$1;
rewrite ^/show-([0-9]+)-([0-9]+)-([0-9]+] .html/index.php?a=show&catid=$1&typeid=$2&id=$3;
The final URL is http://m.xx.com/list-1.html,http://m.xx.com/show-23-7-151.html, which allows you to preview the effect using your phone's input www.xinchaoyue.com/. Mobile version of the site modified half a day also made the template to make a mobile adaptation version of the template to modify the location of the templates directory under the WAP directory. But feel Phpcms Mobile station function is a bit too shabby, not too convenient to do the PC mobile URL one by one corresponding jump.

PHPCMS WAP Mobile Station pseudo static method Nginx

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.