更新时间:2023-09-26 11:36:40
我要存储项目完全独立的文档根目录,例如 /家庭/用户/项目/工程
。
I'd store the project completely separate to the document root, for example /home/user/projects/project
.
然后,只需符号链接 /无功/网络/项目
到 /家庭/用户/项目/工程/公共
Then, simply symlink /var/www/project
to /home/user/projects/project/public
.
只要你使用的baseUrl视图助手任何静态资产链接(JavaScript,图片,CSS等),它应该只是罚款。
Provided you use the BaseUrl view helper for any static asset links (JavaScript, images, CSS, etc), it should work just fine.
修改:另一个建议是从应用程序的其余部分分开的公共目录
Edit: Another suggestion is to separate your public directory from the rest of the application.
举例来说,假设你的项目是 /家庭/用户/项目/工程
,将您的公开$ C $的内容C>目录
/无功/网络/项目
和编辑的index.php
具有以下
For example, say your project is in /home/user/projects/project
, move the contents of your public
directory to /var/www/project
and edit index.php
with the following
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', '/home/user/projects/project/application');