开发者

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

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?


RewriteRule ^other - [L]

should do it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜