Avoid having ugly url access through .htaccess

These urls, both point to the same controller and action,
but I want to avoid the second url from pointing there, and instead shows a 404 error, is it possible?

It is possible, but you'll have to have a special case.

By default, the Phalcon .htaccess file only redirects a URL, if the URL isn't pointing to an actual file. It does this so UI files like images or CSS or Javascript files get served up properly.

If you you want index.php to get redirected, you'll have to add a RewriteCond and possibly a new RewriteRule in your .htaccess file.