phpcms無法打開手機端是因為偽靜態規則不能被識別,其解決辦法是在linux系統中,將“RewriteEngine On RewriteCond%{HTTP_HOST} ^域名.com$ [NC]…”代碼保存為“.htaccess”。
phpcms手機端偽靜態規則,手機端打不開的解決方法
問題描述:phpcms系統換了空間之后,手機端內頁無法打開
問題原因:phpcms的手機版用的是偽靜態,換到其它服務商之后,服務器環境不一樣,導致偽靜態規則不能被識別
?推薦:《phpcms教程》
立即學習“PHP免費學習筆記(深入)”;
解決方案:這里提供 .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> ????????????<match></match> ????????????<action></action> ????????????</rule> ????????????? ????????????<rule> ????????????<match></match> ????????????<action></action> ????????????</rule> ??????????????? ????????????<rule> ????????????<match></match> ????????????<action></action> ????????????</rule> ? ????????????<rule> ????????????<match></match> ????????????<action></action> ????????????</rule> ? ????????????<rule> ????????????<match></match> ????????????<action></action> ????????????</rule> ? ????????????</rules> ??????</rewrite> ? ????????<httperrors> ????????????<clear></clear> ????????</httperrors> ????</system.webserver></configuration>
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END
喜歡就支持一下吧
相關推薦