phpcms无法打开手机端怎么办
生活随笔
收集整理的這篇文章主要介紹了
phpcms无法打开手机端怎么办
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
phpcms無法打開手機端是因為偽靜態規則不能被識別,其解決辦法是在Linux系統中,將“RewriteEngine On RewriteCond%{HTTP_HOST} ^域名.com$ [NC]...”代碼保存為“.htaccess”。
phpcms手機端偽靜態規則,手機端打不開的解決方法
問題描述:phpcms系統換了空間之后,手機端內頁無法打開
問題原因:phpcms的手機版用的是偽靜態,換到其它服務商之后,服務器環境不一樣,導致偽靜態規則不能被識別
推薦:《phpcms教程》
解決方案:這里提供 .htaccess 和 web.config 兩個偽靜態規則供大家使用
Linux系統,將以下代碼保存為 .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^域名.com$ [NC]
RewriteRule ^(.*)$ http://www.域名.com/$1 [L,R=301]
RewriteRule ^(.*)content-([0-9]+)-([0-9]+)-([0-9]+)\\.html(.*)$ $1/index\\.php\\?m=content&c=index&a=show&catid=$2&id=$3&page=$4
RewriteRule ^(.*)show-([0-9]+)-([0-9]+)-([0-9]+).html(.*)$ $1/index\\.php\\?m=content&c=index&a=show&catid=$2&id=$3&page=$4
RewriteRule ^(.*)list-([0-9]+)-([0-9]+).html(.*)$ $1/index\\.php\\?m=content&c=index&a=lists&catid=$2&page=$3
Windows系統,將以下代碼保存為 web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Index" stopProcessing="true">
<match url="^content-([0-9]+)-([0-9]+)-([0-9]+).html" />
<action type="Rewrite" url="index.php?m=content&c=index&a=show&catid={R:1}&id={R:2}&page={R:3}" />
</rule>
<rule name="Show" stopProcessing="true">
<match url="^show-([0-9]+)-([0-9]+)-([0-9]+).html" />
<action type="Rewrite" url="index.php?m=content&c=index&a=show&catid={R:1}&id={R:2}&page={R:3}" />
</rule>
<rule name="list" stopProcessing="true">
<match url="^list-([0-9]+)-([0-9]+).html" />
<action type="Rewrite" url="index.php?m=content&c=index&a=lists&catid={R:1}&page={R:2}" />
</rule>
<rule name="wapshow" stopProcessing="true">
<match url="^wapshow-([0-9]+)-([0-9]+).html" />
<action type="Rewrite" url="index.php?m=wap&siteid=1&a=show&catid={R:1}&typeid=&id={R:2}" />
</rule>
<rule name="waplist" stopProcessing="true">
<match url="^waplist-([a-zA-Z]+)-([0-9]+).html" />
<action type="Rewrite" url="index.php?m=wap&c=index&a={R:1}&catid={R:2}" />
</rule>
</rules>
</rewrite>
<httpErrors errorMode="DetailedLocalOnly">
<clear />
</httpErrors>
</system.webServer>
</configuration>
總結
以上是生活随笔為你收集整理的phpcms无法打开手机端怎么办的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: phpcms:八、show.html
- 下一篇: 014、BOM与DOM对象的应用