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

报告相同问题?

悬赏问题

  • ¥15 phython如何实现以下功能?查找同一用户名的消费金额合并—
  • ¥15 孟德尔随机化怎样画共定位分析图
  • ¥18 模拟电路问题解答有偿速度
  • ¥15 CST仿真别人的模型结果仿真结果S参数完全不对
  • ¥15 误删注册表文件致win10无法开启
  • ¥15 请问在阿里云服务器中怎么利用数据库制作网站
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址