duanhuan1147 2011-09-14 16:35
浏览 38
已采纳

将另一个基于子目录的应用程序添加到基于Zend Framework子目录的应用程序

I have a php web app created with the zend framework. The document root is public_html and the hosting provider will not let me change it to the public_html/public subdirectory. That wasn't a problem as I found the following .htaccess file which allowed my app to work with the following directory layout:

public_html/public
public_html/application
public_html/application/controllers

etc..

RewriteEngine On

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]

RewriteRule ^\.htaccess$ - [F]

RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]

RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]

RewriteRule ^public/.*$ /public/index.php [NC,L]

Now I have a new requirement that I need to run another web app from a different subdirectory under public_html for the same domain, lets call it other, i.e. public_html/other

I've tried modifying the .htaccess file to redirect any requests containing "other" to the public_html/other subdirectory, but it always results in a 500 system error, for example if I add:

RewriteCond %{REQUEST_URI} !^/other/.*$
RewriteRule ^(.*)$ /other/$1

Everything breaks and all requests result in a 500 system error. Any suggestion on how to craft the rewrite rules to make this happen?

  • 写回答

1条回答 默认 最新

  • dongpanshi2839 2011-09-14 16:38
    关注
    RewriteRule ^other - [L]
    

    should do it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭