why my url has public directory

I used $url->get('a'); to make links but my links :

http://localhost/public/a

How can I remove public from link?

My root htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule  ^$ public/    [L]
    RewriteRule  (.*) public/$1 [L]
</IfModule>

and the dispatcher url

    /**
     * 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($config->application->baseUri);
        return $url;
    });

the base uri : http://localhost/

Can you try:

Phalcon\Tag::linkTo("a", "My Link")

Show you config file or replace:

$url = new \Phalcon\Mvc\Url();
- $url->setBaseUri($config->application->baseUri);
+ $url->setBaseUri('/');


1.1k

Phalcon is running on my document root. the $url->get() consistently addes "public". when i use $url->setBaseUri('/'), the urls generated then adds "//public//"