coolicer
V2EX  ›  PHP

帮我看看这个thinkphp的后台目录怎么设置

  •  
  •   coolicer · Dec 10, 2013 · 5485 views
    This topic created in 4711 days ago, the information mentioned may be changed or developed.
    我这个是从网上抄的结构
    ---www
    ------www.demo.com
    ------------------/ThinkPHP/<!--TP文件夹-->
    ------------------/Admin/<!--管理后台-->
    ------------------/App/<!--前台-->
    ------------------/index.php<!--前台入口文件-->
    ------------------/admin.php<!--后台入口文件-->

    http://www.demo.com:8080/index.php/Index/index 前台
    http://www.demo.com:8080/admin.php/Index/index 后台

    现在重写了规则,把入口文件去掉了,所以2个URL一样了,http://www.demo.com:8080/Index/index

    我不知道怎么改写。
    if (!-e $request_filename) {
    rewrite ^/(.*)$ /index.php/$1 last;
    break;
    }
    这一段也是网上来的
    8 replies  •  1970-01-01 08:00:00 +08:00
    bearcat001
    bearcat001
    Dec 10, 2013❤️1
    1
    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    </IfModule>
    coolicer
    coolicer
    OP
    Dec 10, 2013
    2
    忘了说是nginx
    coolicer
    coolicer
    OP
    Dec 10, 2013
    3
    @bearcat001 忘了说是nginx
    bearcat001
    bearcat001
    Dec 10, 2013❤️1
    4
    @coolicer =0= nginx没配置过,看看有没有人了解,规则类似吧~
    coolicer
    coolicer
    OP
    Dec 10, 2013
    5
    @bearcat001 你把这个配置翻译成人话给我 = =,看不懂
    bearcat001
    bearcat001
    Dec 10, 2013
    6
    @coolicer
    RewriteEngine on 打开rewrite
    RewriteCond %{REQUEST_FILENAME} !-d 目录直接访问
    RewriteCond %{REQUEST_FILENAME} !-f 文件直接访问
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] 非目录和文件全部转到index.php下
    markmx
    markmx
    Dec 10, 2013
    7
    我一般都是 分开 前后台的目录的。
    后台一般会放在另一个文件夹中的。
    这样同时你的后台的JS 也不会和前台有什么冲突的。
    并且 后台一般不开启。伪路径。
    zts1993
    zts1993
    Dec 11, 2013
    8
    一楼应该是对的。。。喜欢分组。。这种风格现在感觉好奇怪
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1468 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 22:03 · PVG 06:03 · LAX 14:03 · JFK 17:03
    ♥ Do have faith in what you're doing.