We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to use Phalcon without .htaccess?

My .htaccess

<IfModule mod_rewrite.c> RewriteEngine on

RewriteRule  ^$ public/    [L]
RewriteRule  (.*) public/$1 [L]

</IfModule>

What do you want? Avoid that rewrite from .htaccess without change your app structure?

Simply put your public folder as document root in the VH block

<VirtualHost *:80>
    # ...
    DocumentRoot /var/www/html/mywebsite/public
    # ...
</VirtualHost>


3.7k

I am using .htaccess to rewrite the public folder, but I can not remove it. example I access => mydomain.com/path/ and shows the folder normally, but when I go => mydomain.com/path without the "/" and the url is loaded => mydomain.com/public/path/.

I want to remove the "public" in the url.

edited Mar '15

So /path is a folder with public access?

Try with this then:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule  ^$ public/    [L]
RewriteRule  (.*) public/$1 [L]