Reputation: 85
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 www.domain.it/public/controlle/action?
How can i remove the public on the url?
Upvotes: 1
Views: 1006
Reputation: 69957
Delete the public folder, put your .htaccess
and index.php
file in your public_html
folder or the equivalent. The public
directory in Zend Framework is just a placeholder for whatever your actual public web directory is.
Use the standard Zend Framework .htaccess
file. You don't need any fancy rewrite rules.
You can put your ZF application files one level up from your public_html
folder, or anywhere else. If you don't put them one level up from public, make sure to change APPLICATION_PATH
in index.php to reflect the correct location.
Upvotes: 4