March 1, 2012
Zendframework project shows xyz.com/public/ so how to remove public
Question by Zuber Surya
My zendFramework application on server shows
xyz.com/public/login
i want it like
xyz.com/login
how to achieve this ? is it possible to do with .htaccess
file.
Thanks in advance
Answer by Starx
This is my answer from another question, but seems to fit in this question too. In the case you already have a .htaccess
file inside public
, use the htaccess
solution from below.
The problem seems to be due to the root not being routed to /public
.
-
The proper way: You need to setup a vhost and point the root to the
public
directory. -
Another Way: You need to redirect every request inside
public
directory. The.htaccess
for this file would beRewriteRule ^.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /public/index.php [NC,L] RewriteCond %{REQUEST_URI} !^/public/.*$ RewriteRule ^(.*)$ /public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.*$ - [NC,L] RewriteRule ^public/.*$ /public/index.php [NC,L]