Hi i’ve done a zend project that works on localhost correctly. Now i want to put it on a server web…i don’t have permission to create a virtual host so all i can use is .htaccess. I have a htaccess on a root like that
RewriteEngine On
RewriteRule !^public/ /public%{REQUEST_URI} [L,R=301]
And the htaccess on the public folder
SetEnv APPLICATION_ENV production
RewriteEngine On
RewriteBase /public
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
but when i see the url of the remote page is http://www.domain.it/public/controlle/action?
How can i remove the public on the url?
Delete the public folder, put your
.htaccessandindex.phpfile in yourpublic_htmlfolder or the equivalent. Thepublicdirectory in Zend Framework is just a placeholder for whatever your actual public web directory is.Use the standard Zend Framework
.htaccessfile. You don’t need any fancy rewrite rules.You can put your ZF application files one level up from your
public_htmlfolder, or anywhere else. If you don’t put them one level up from public, make sure to changeAPPLICATION_PATHin index.php to reflect the correct location.