联系官方销售客服

1835022288

028-61286886

开发框架 版主:迅睿框架研发组
伪静态是这样写的"member.html?(.*)" => 'index.php?s=member&$1',
类型:迅睿CMS 更新时间:2020-10-14 11:19:32

www.xunruicms.com用户中心的伪静态怎么弄的

看这个文档https://www.xunruicms.com/doc/547.html弄好了

伪静态是这样写的"member.html?(.*)" => 'index.php?s=member&$1',

现在的问题是如果用户已经登录可以正常用,如果未登录就有一下错误

{xunruicms_img_title}

回帖
  • #1楼    迅睿框架创始人
    2020-10-14 09:57:00
    Chrome 0
    url太长了,这个是
  • 卧龙隐者
    #2楼    卧龙隐者
    2020-10-14 10:00:23
    Chrome 0
    为什么会变成这样未登录时访问member.html?c=login&m=index就变成http://127.0.0.1:81/member.html?c=login&m=index&back=http%253A%252F%252F127.0.0.1%253A81%252Fmember.html%253Fc%253Dlogin%2526m%253Dindex%2526back%253Dhttp%2525253A%2525252F%2525252F127.0.0.1%2525253A81%2525252Fmember.html%2525253Fc%2525253Dlogin%25252526m%2525253Dindex%25252526back%2525253Dhttp%25252525253A%25252525252F%25252525252F127.0.0.1%25252525253A81%25252525252Fmember.html%25252525253Fc%25252525253Dlogin%252525252526m%25252525253Dindex%252525252526back%25252525253Dhttp%252525252525253A%252525252525252F%252525252525252F127.0.0.1%252525252525253A81%252525252525252Fmember.html%252525252525253Fc%252525252525253Dlogin%2525252525252526m%252525252525253Dindex%2525252525252526back%252525252525253Dhttp%2525252525252525253A%2525252525252525252F%2525252525252525252F127.0.0.1%2525252525252525253A81%2525252525252525252Fmember.html%2525252525252525253Fc%2525252525252525253Dlogin%25252525252525252526m%2525252525252525253Dindex%25252525252525252526back%2525252525252525253Dhttp%25252525252525252525253A%25252525252525252525252F%25252525252525252525252F127.0.0.1%25252525252525252525253A81%25252525252525252525252Fmember.html%25252525252525252525253Fc%25252525252525252525253Dlogin%252525252525252525252526m%25252525252525252525253Dindex%252525252525252525252526back%25252525252525252525253Dhttp%252525252525252525252525253A%252525252525252525252525252F%252525252525252525252525252F127.0.0.1%252525252525252525252525253A81%252525252525252525252525252Fmember.html%252525252525252525252525253Fc%252525252525252525252525253Dlogin%2525252525252525252525252526m%252525252525252525252525253Dindex%2525252525252525252525252526back%252525252525252525252525253Dhttp%2525252525252525252525252525253A%2525252525252525252525252525252F%2525252525252525252525252525252F127.0.0.1%2525252525252525252525252525253A81%2525252525252525252525252525252Fmember.html%2525252525252525252525252525253Fc%2525252525252525252525252525253Dlogin%25252525252525252525252525252526m%2525252525252525252525252525253Dindex%25252525252525252525252525252526back%2525252525252525252525252525253Dhttp%25252525252525252525252525252525253A%25252525252525252525252525252525252F%25252525252525252525252525252525252F127.0.0.1%25252525252525252525252525252525253A81%25252525252525252525252525252525252Fmember.html%25252525252525252525252525252525253Fc%25252525252525252525252525252525253Dlogin%252525252525252525252525252525252526m%25252525252525252525252525252525253Dindex%252525252525252525252525252525252526back%25252525252525252525252525252525253Dhttp%252525252525252525252525252525252525253A%252525252525252525252525252525252525252F%252525252525252525252525252525252525252F127.0.0.1%252525252525252525252525252525252525253A81%252525252525252525252525252525252525252Fmember.html%252525252525252525252525252525252525253Fc%252525252525252525252525252525252525253Dlogin%2525252525252525252525252525252525252526m%252525252525252525252525252525252525253Dindex%2525252525252525252525252525252525252526back%252525252525252525252525252525252525253Dhttp%2525252525252525252525252525252525252525253A%2525252525252525252525252525252525252525252F%2525252525252525252525252525252525252525252F127.0.0.1%2525252525252525252525252525252525252525253A81%2525252525252525252525252525252525252525252Fmember.html%2525252525252525252525252525252525252525253Fc%2525252525252525252525252525252525252525253Dlogin%25252525252525252525252525252525252525252526m%2525252525252525252525252525252525252525253Dindex%25252525252525252525252525252525252525252526back%2525252525252525252525252525252525252525253Dhttp%25252525252525252525252525252525252525252525253A%25252525252525252525252525252525252525252525252F%25252525252525252525252525252525252525252525252F127.0.0.1%25252525252525252525252525252525252525252525253A81%25252525252525252525252525252525252525252525252Fmember.html%25252525252525252525252525252525252525252525253Fc%25252525252525252525252525252525252525252525253Dlogin%252525252525252525252525252525252525252525252526m%25252525252525252525252525252525252525252525253Dindex%252525252525252525252525252525252525252525252526back%25252525252525252525252回复迅睿框架创始人
  • #3楼    迅睿框架创始人
    2020-10-14 10:34:18
    Chrome 0
    我把官网的规则发给你参考以下my目录的library/router.php首字母大写
    <?php namespace My\Library;
    
    class Router extends \Phpcmf\Library\Router
    {
    
        // 重写会员路由
        function member_url($url, $query = [], $self = SELF)
        {
            
            $url = parent::member_url($url, $query, $self );
            return str_replace('index.php?s=member&', 'member.html?', $url);
        }
        
        }
    解析规则是config/router.php
    <?php
    // 自定义URL路由模式
    
    if (strpos($uri, 'member.html?') === 0) {
        $is_404 = 0;
        $arr = parse_url($uri);
        parse_str($arr['query'],$_GET);
        $_GET['s'] = 'member';
    }
  • 自学成才
    #4楼    自学成才
    2020-10-14 10:35:25
    Chrome 0
    https://www.xunruicms.com/doc/547.html 我也是按照这个文档来做的,但是你为什么要写

    ,文档里面没有提到写这个啊
  • 卧龙隐者
    #5楼    卧龙隐者
    2020-10-14 11:11:54
    Chrome 0
    不写伪静态,我会提示404错误,栏目(member)不存在你的只要按文档那两个步骤就好了吗自学成才
  • 易学习
    #6楼    易学习
    2020-10-14 11:14:27
    Chrome 0
    栏目(member)不存在是冲突了,你把rewrite.php请清空试一试,我怀疑是冲突了
    满意答案
  • 卧龙隐者
    #7楼    卧龙隐者
    2020-10-14 11:19:32
    Chrome 0
    @易学习:原来如此,清空就行了