URL Problem

Hello I'm learning Phalconphp and i'm facing some problem with URLs. Currently I'm following this http://docs.phalcon.io/en/latest/reference/tutorial.html tutorial.

My site url: http://localhost/phalconphp

I've created an index page where it shows "Signup here" hyperlink. When I clicked on the link, it goes to "http://localhost/public/signup" instead of "http://localhost/hellophalcon/public/signup"

It happens with every hyperlink, even I created form and again it redirect me to http://localhost/public/signup/register instead of http://localhost/hellophalcon/public/signup/register

Yes I've added an htaccess file on both root and public folder.

Add in you index.php:

  $di = new Phalcon\DI\FactoryDefault();
     * The URL component is used to generate all kind of urls in the application
    $di->set('url', function() use ($config){
        $url = new \Phalcon\Mvc\Url();
        $url->setBaseUri( '/phalconphp/' ); // or $url->setBaseUri( 'http://localhost/phalconphp' );
        return $url;


Thanks, works fine.