Zend - redirect to "public" subdir with htaccess
I started to develop an application with netbeans+zend. I have a host and uploaded the project files there, but I haven't managed to redirect the request from the root directory to the public subdirectory yet. I get the 404 error page of the zend project by every request. Can anybody help me?
addons:
I redirect with the following htaccess (wwwroot/.htaccess):
RewriteEngine On
Rew开发者_如何学PythonriteRule ^(.*)$ public/$1 [NC,QSA]
In the public folder is the default (generated) htaccess of the project (wwwroot/public/.htaccess):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
The zend project is in the wwwroot, I don't have any access to apache config, can create only htaccess files. The zend framework files are in the wwwroot/library/zend. The project files are included on localhost, but not on my godaddy host. :S
On localhost I get the porject 404 page by every request, on the godaddy I get the following error:
Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/14/7811914/html/public/index.php on line 18
If I remove the wwwroot/htaccess, and use "http://localhost/public/" I get the zend fw opening page, so it works, without redirection, so I think on localhost I have a routing problem and I have to overwrite something in bootstrap, or somewhere... On godaddy I don't know what the problem is... Maybe the lowercase file names, I try to extend the autoload module with a tolowercase function call... (tomorrow...)
You must configure your webserver using the new document root.
When having access to the .httpd.conf you can set the new document root there for you domain.
When using confixx you find that below the point "domains", in your admin panel.
when using plesk you can edit the vhost specific config in the domain's conf foler named vhost.conf
<Directory /var/www/vhosts/yourdomain.com/httpdocs/public>
Options -Includes -ExecCGI
SetEnv APPLICATION_ENV "development"
</Directory>
DocumentRoot /var/www/vhosts/yourdomain.com/httpdocs/public
After that run your plesk update script.
/usr/local/psa/admin/sbin/websrvmng -u --vhost=yourdomain.com
I found the solution here: http://www.warpturn.com/zend-framework-on-godaddy-shared-hosting-linux/
It was a set_include_path problem. I replaced the set_include_path paramters in public/index.php, and after that everything was ok.
精彩评论