We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Remove App Directory from URL

Hi, I'm using the Phalcon Vagrant Box for my project. My project is located in vagrants www folder. The problem now is that I have the project folder in my URL. So I can access my app with mysite.dev/project-dir/controller/method/ But I want something like this: mysite.dev/controller/method

What is the best way to get rid of the project-dir in the URL? I assume some .htaccess magic has to happen? :-) Thanks for your help!

Why just not set nginx/apache root directory for project-dir ?

# /var/www/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule  ^$ project-dir/    [L]
    RewriteRule  ((?s).*) project-dir/$1 [L]

  1. Please provide a full path to the phalcon project.
  2. Could you change VHosts?

From my perspective, you had default vhost with document root /var/www