Home  >  Article  >  Backend Development  >  thinphp linux下 rewrite

thinphp linux下 rewrite

WBOY
WBOYOriginal
2016-09-27 14:04:33914browse

thinphp linux下 rewrite
有两个入口,index.php和admin.php
index.php入口方面已经解决用了官方的方法

<code>    location / {   
        if (!-e $request_filename) {
            rewrite  ^(.*)$  /index.php?s=$1  last;    
            break;    
        } 
    }</code>

同时隐藏了index.php 访问地址http://xxxx/login/login 可用,前台正常

访问后台admin.php时, 访问地址http://xxxx/admin.php/login/l... ,首页访问正常,其他模块出现404
thinphp linux下 rewrite

而url模式下http://xxxx/admin.php?c=login...可以访问正常
thinphp linux下 rewrite
求教,如何让admin.php可以用/xx/xx访问,如果要改rewrite规则,如何定义

简单说,问题的根源是需要http://xxxx/login/login可以跳转到index.php/login/login
,http://xxxx/admin.php/login/l...正常使用,然而rewrite把所有的servicename后面的路径改成了servicename/index.php/login/login,所以admin.php也不例外,如何兼容这两种需求呢,rewrite如何不冲突,不覆盖

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn