没有虚拟主机的 Zend Framework 应用程序 [英] Zend Framework application without virtual hosts
本文介绍了没有虚拟主机的 Zend Framework 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在不设置虚拟主机的情况下在 Windows(Apache 或 IIS)上配置 Web 服务器,以便可以通过像 http://example.com/myapp 而不是 http://example.com/myapp/公开?
Is it possible to configure web server on Windows (Apache or IIS) without setting up virtual hosts so Zend Framework application could be accessed with link like http://example.com/myapp rather than http://example.com/myapp/public?
推荐答案
使用这个 .htaccess
use this .htaccess
RewriteEngine On
RewriteRule ^(.*)$ public/$1?%{QUERY_STRING} [QSA,L]
并将其放入 application.ini
and put this in application.ini
resources.frontController.baseUrl = "/myapp/"
这篇关于没有虚拟主机的 Zend Framework 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文