问题场景:
云优CMS在阿里云虚拟主机nginx伪静态配置教程
凯铧互联小编回复:
1请先登录阿里云虚拟主机管理平台面板-高级环境设置-NGINX设置 复制下面到配置框里即可,只适用于阿里云虚拟主机nginx环境,其他环境请勿适用
伪静态代码如下
location / {
rewrite ^/statics/ueditor/dialogs/(.*)/(.*).html$ /statics/ueditor/dialogs/$1/$2.html break;
rewrite ^/phpMyAdmin/(.*)$ /phpMyAdmin/$1 last;
rewrite ^/404.htm$ /index.php?s=index/index/empty404 last;
rewrite ^/admin/(.*).html$ /index.php?s=admin/$1 last;
rewrite ^/admin/(.*)$ /index.php?s=admin/$1 last;
rewrite ^/config/(.*)$ /404.htm last;
rewrite ^/m/$ /index.php?s=wap/index/index last;
rewrite ^/m/myform/$ /index.php?s=wap/myform/index last;
rewrite ^/m/captcha/(\d*)$ /index.php?s=wap/myform/captcha&id=$1 last;
rewrite ^/m/search/$ /index.php?s=wap/search/index last;
rewrite ^/m/(.*)_search/$ /index.php?s=wap/search/index&area=$1 last;
rewrite ^/m/tag/([\s\S]*)$ /index.php?s=wap/tag/index&title=$1 last;
rewrite ^/m/(.*)_tag/([\s\S]*)$ /index.php?s=wap/tag/index&title=$2&area=$1 last;
rewrite ^/m/(.*)/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$4&ctitle=$1/$3&area=$2&cw=$5 last;
rewrite ^/m/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$3&ctitle=$2&area=$1&cw=$4 last;
rewrite ^/m/(.*)/(.*)_(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$4&ctitle=$1/$3&area=$2 last;
rewrite ^/m/(.*)_(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$3&ctitle=$2&area=$1 last;
rewrite ^/m/(.*)/(.*)_(.*).html$ /index.php?s=wap/show/index&etitle=$2&ctitle=$1&cw=$3 last;
rewrite ^/m/(.*)/(.*).html$ /index.php?s=wap/show/index&etitle=$2&ctitle=$1 last;
rewrite ^/m/(.*)/(.*)_(.*)/$ /index.php?s=wap/category/index&ctitle=$1/$3&area=$2 last;
rewrite ^/m/(.*)_(.*)/$ /index.php?s=wap/category/index&ctitle=$2&area=$1 last;
rewrite ^/m/(.*)/(.*)_(.*)/page/(\d*)$ /index.php?s=wap/category/index&ctitle=$1/$3&area=$2&page=$4 last;
rewrite ^/m/(.*)_(.*)/page/(\d*)$ /index.php?s=wap/category/index&ctitle=$2&area=$1&page=$3 last;
rewrite ^/m/(.*)/$ /index.php?s=wap/category/index&ctitle=$1 last;
rewrite ^/m/(.*)/page/(\d*)$ /index.php?s=wap/category/index&ctitle=$1&page=$2 last;
rewrite ^/m/(.*).html$ /index.php?s=wap/index/index&area=$1 last;
rewrite ^/index(.*)/$ /index.php?s=index/index/index/$1 last;
rewrite ^/myform/$ /index.php?s=index/myform/index last;
rewrite ^/(.*)_myform/$ /index.php?s=index/myform/index&area=$1 last;
rewrite ^/captcha/(\d*)$ /index.php?s=index/myform/captcha&id=$1 last;
rewrite ^/(.*)_captcha/(\d*)$ /index.php?s=index/myform/captcha&area=$1&id=$2 last;
rewrite ^/search/$ /index.php?s=index/search/index last;
rewrite ^/search/page/(\d*)$ /index.php?s=index/search/index&page=$1 last;
rewrite ^/search/key/(.*)/page/(\d*)$ /index.php?s=index/search/index&key=$1&page=$2 last;
rewrite ^/(.*)_search/$ /index.php?s=index/search/index&area=$1 last;
rewrite ^/(.*)_search/page/(\d*)$ /index.php?s=index/search/index&area=$1&page=$2 last;
rewrite ^/(.*)_search/key/(.*)/page/(\d*)$ /index.php?s=index/search/index&area=$1&key=$2&page=$3 last;
rewrite ^/(.*)_tag/([\s\S]*)/page/(\d*)$ /index.php?s=index/tag/index&title=$2&area=$1&page=$3 last;
rewrite ^/(.*)_tag/([\s\S]*)$ /index.php?s=index/tag/index&title=$2&area=$1 last;
rewrite ^/tag/([\s\S]*)/page/(\d*)$ /index.php?s=index/tag/index&title=$1&page=$2 last;
rewrite ^/tag/([\s\S]*)$ /index.php?s=index/tag/index&title=$1 last;
rewrite ^/(.*)/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$4&ctitle=$1/$3&area=$2&cw=$5 last;
rewrite ^/(.*)_(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$3&ctitle=$2&area=$1&cw=$4 last;
rewrite ^/(.*)/(.*)_(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$4&ctitle=$1/$3&area=$2 last;
rewrite ^/(.*)_(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$3&ctitle=$2&area=$1 last;
rewrite ^/(.*)/(.*)_(.*).html$ /index.php?s=index/show/index&etitle=$2&ctitle=$1&cw=$3 last;
rewrite ^/(.*)/(.*)_(.*)/$ /index.php?s=index/category/index&ctitle=$1/$3&area=$2 last;
rewrite ^/(.*)_(.*)/$ /index.php?s=index/category/index&ctitle=$2&area=$1 last;
rewrite ^/(.*)/(.*)_(.*)/page/(\d*)$ /index.php?s=index/category/index&ctitle=$1/$3&area=$2&page=$4 last;
rewrite ^/(.*)_(.*)/page/(\d*)$ /index.php?s=index/category/index&ctitle=$2&area=$1&page=$3 last;
rewrite ^/(.*)/$ /index.php?s=index/category/index&ctitle=$1 last;
rewrite ^/(.*)/page/(\d*)$ /index.php?s=index/category/index&ctitle=$1&page=$2 last;
rewrite ^/index.html$ /index.php?s=index/index/index last;
rewrite ^/(.*)/(.*).html$ /index.php?s=index/show/index&etitle=$2&ctitle=$1 last;
rewrite ^/(.*).html$ /index.php?s=index/index/index&area=$1 last;
}
location ~ /\.ht {
deny all;
}
今天的分享就到这里啦,若您需要帮助可以直接联系我方客服,阿里云代理商凯铧互联专业技术团队为您提供全面/便捷/专业的7x24技术服务。
为什么选择我们:北京凯铧互联科技有限公司(简称凯铧互联)由多名前阿里云资深技术专家创立,核心员工来自阿里云、腾讯云等,作为阿里云,腾讯云,百度云,金山云重要的合作伙伴,专注于为企业用户提供云计算及云计算的解决方案。总部设在北京,并在内蒙设有办事处。做为一家综合性方案商,凯铧互联向各行业用户提供基于云计算的各种解决方案。为用户获得优质服务的同时,秉承"专业规划、周到服务"的服务理念,根据用户的实际情况,充分考虑各种网络资源的特点及功效,为用户量身定做一套适合于其实际应用需求的网络应用方案。帮助用户利用互联网的力量展开新的营销方式,并大大缩短了项目实施周期,获得用户的一致好评。
凯铧互联专属服务:阿里云代理商凯铧互联为每一个用户提供专属网络架构服务,提供7x24一对一技术服务,远程协助等。同时还能提供阿里云服务器ECS、阿里云CDN等产品等的专属折扣优惠购买,让用户能够便捷、更省的上云。如果您需要详细的为您的企业选择最适合自己的服务器配置类型,请您联系客服,专业人员为您提供服务,同时还能获得更多的优惠折扣,电话专线:136-5130-9831,QQ:3398234753。
阿里云代理商凯铧互联提供阿里云服务器,云服务器解决方案,万网虚拟主机,阿里云邮箱,云数据库RDS,对象存储OSS,负载均衡,CDN、云盾安全,DDOS高防IP等产品的全国代买服务,直属会员+双重售后服务+更多优惠政策。