初学Phreeze 2

我在_app_config.php里面定义了

1 GlobalConfig::$ROUTE_MAP = array(

2 

3 'GET:' => array('route' => 'Default.Home'),

4 #    'GET:' => array('route' => 'Zj.Gdata'),

5     'POST:zj' => array('route' => 'Zj.Gdata')

6 );

在那个跳转页面的代码:

1 <h1>zj,hello ! </h1>

2 <form action='zj' method='post' >

3     <input type='submit' value='Click,good Luck!'>

4 </form>

刚开始每次点击都出现500的错误,后来经过前辈指导才发现,原来nginx.conf还需要修改内容如下:

nginx.conf

原文地址:https://github.com/jasonhinkle/phreeze/blob/master/ngnix.conf.example

注意修改的时候,把项目名称也改了啊

 location ~ ^/phreeze/builder/(.*) {

        try_files /phreeze/builder/$1 /phreeze/builder/$1/ /phreeze/builder/index.php?_REWRITE_COMMAND=$1&args;

    }

重启nginx服务器,并且在自己的项目中要有重写文件:

.htaccess
 1 ## Phreeze .htaccess file

 2 

 3 ## for php troubleshooting enable errors

 4 # php_flag display_errors 1

 5 # php_value error_reporting 1 # (or 8191 for all errors)

 6 

 7 <IfModule mod_rewrite.c>

 8     Options +FollowSymLinks

 9     RewriteEngine On

10     

11     ## some servers require this to be changed to app directory

12     # RewriteBase /

13 </IfModule>

14 

15 # redirect all requests to index.php except for directories

16 # and files that physically exist on the server

17 <IfModule mod_rewrite.c>

18     RewriteCond %{REQUEST_FILENAME} !-f

19     RewriteCond %{REQUEST_FILENAME} !-d

20     RewriteRule (.*) index.php?_REWRITE_COMMAND=$1 [QSA,L]

21 </IfModule>

22 

23 # Add correct mime type for web fonts to prevent browser warnings

24 <IfModule mod_mime.c>

25     AddType application/vnd.ms-fontobject eot

26     AddType font/opentype otf

27     AddType font/truetype ttf

28     AddType application/x-font-woff woff

29 </IfModule>

这个重写文件的内容,自己看吧

你可能感兴趣的:(r)