RyuGou
RyuGou

Reputation: 71

Phalcon route not working, all urls access index

I use phalcon-dev-tools-v2.0.13 create a project named test,I accessed root url "/",it worked!then,I change some code like this: enter image description here

it worked!

enter image description here

but:

enter image description here

i add another url ,it didn't work!

enter image description here

what's the matter? I'm a Phalcon fresher,i followed the Phalcon doc. My system is php5.6.30 Phalcon2.0.13, nginx conf file is:

server {
             listen      80;
             server_name test;
             root /Users/ryugou/test/public;
             index  index.php index.html index.htm;
             charset     utf-8;

      location / {
            try_files $uri $uri/ /index.php;
     }

    location ~ \.php$ {
         try_files     $uri =404;

         fastcgi_pass  127.0.0.1:9000;
         fastcgi_index /index.php;

         include fastcgi_params;
         fastcgi_split_path_info       ^(.+\.php)(/.+)$;
         fastcgi_param PATH_INFO       $fastcgi_path_info;
         fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      }

     location ~ /\.ht {
         deny all;
     }
}

Upvotes: 0

Views: 442

Answers (1)

Fazal Rasel
Fazal Rasel

Reputation: 4526

your problem is on nginx configuration file. You are not passing _url on location block-

modify location block as (careful last part)-

location / {
        try_files $uri $uri/ /index.php?_url=$uri&$args;
    }

check Phalcon Nginx Config

Upvotes: 2

Related Questions