dongle19863 2011-07-07 11:34
浏览 86
已采纳

Zend - 使用htaccess重定向到“public”子目录

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
RewriteRule ^(.*)$ 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...)

  • 写回答

2条回答 默认 最新

  • drddx3115 2011-07-10 16:14
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料