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条)

报告相同问题?

悬赏问题

  • ¥30 YOLO检测微调结果p为1
  • ¥20 求快手直播间榜单匿名采集ID用户名简单能学会的
  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题