代码之家  ›  专栏  ›  技术社区  ›  Adam Ramadhan

nginx中的mvc问题

  •  0
  • Adam Ramadhan  · 技术社区  · 15 年前

    你好,我想做一个mvc,至少是学习求婚,

    例子,

    /application/test.php
    /views
    /model
    index.php
    

    当我去

    www.mvc.com/test.php
    

    它将直达 test.php

    有办法做这种事吗? 也许用htacsess?如果im在nginx中(im new to nginx )有什么样的htacses可以让我得到url然后重定向(比如 router.php 是吗?)

    谢谢你来找我

    亚当·拉马丹

    1 回复  |  直到 15 年前
        1
  •  1
  •   bcosca    15 年前
    server {
        root /var/www/html/application;
        location / {
            index index.php index.html index.htm;
            if (!-f $request_filename) {
                rewrite ^(.+)$ /test.php last;
                break;
            }
        }
    }