[英]Symfony 3 serve static html file at root
I made a few months ago a symfony website for a client. 几个月前,我为客户建立了一个symfony网站。
Today he asks me to add a simple static html file to the root of the website, that contains nothing but a hash. 今天,他要求我向网站的根目录添加一个简单的静态html文件,该文件只包含一个哈希。 (This file will be used by a community manager to register the website somewhere).
(社区管理员将使用此文件在某个地方注册网站)。
Then I asked myself, what is the simplest way to tell Symfony to serve this static html file just as simple apache would do, by just placing it to the root folder ? 然后我问自己,告诉Symfony将简单的apache放置到根文件夹中的最简单方法是像简单的apache一样来提供此静态html文件?
To be clear, this file must be accessed at the root level, just as an index file. 为了清楚起见,必须在根级别访问该文件,就像索引文件一样。 What makes it not convenient is that its name is a hash itself.
不方便的是它的名称本身就是哈希。
如果您使用的是apache和默认的.htaccess
文件,则如果文件存在于public / web目录中,则将直接提供该文件。
您的apache / nginx配置是什么样的?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.