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


Adding another subdirectory based application to a Zend Framework subdirectory based application

我有一个用zend框架创建的php web应用程序。文档根是public_html,宿主提供程序不允许我将其更改为public_html/public子目录。这不是问题,因为我发现了以下.htaccess文件,它允许我的应用程序使用以下目录布局:

public_html/public
public_html/application
public_html/application/controllers

等等。。

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]

现在,我有一个新的要求,即我需要从同一域的public_html下的不同子目录运行另一个web应用程序,让我们称之为other,即public_html/other

我曾尝试修改.htaccess文件,将任何包含"other"的请求重定向到public_html/other子目录,但它总是会导致500系统错误,例如,如果我添加:

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

所有中断和所有请求都会导致500系统错误。关于如何制定重写规则来实现这一点,有什么建议吗?

RewriteRule ^other - [L]

应该这样做。