如何获取真实路径和别名路径

发布于 2024-10-05 20:34:00 字数 164 浏览 0 评论 0原文

在我的 Rails 应用程序中,我在 apache httpd.conf 添加了一个别名路径,如下所示:

alias /ckfinder /var/www/html/ckfinder

但是,我如何获取模型中“/ckfinder”的真实路径?谢谢。

In my rails app,I have add a alias path at apache httpd.conf like this:

alias /ckfinder /var/www/html/ckfinder

but ,how i can get the real path of '/ckfinder' in model? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

或十年 2024-10-12 20:34:00

我不认为除了读取 apache 配置文件并自己解释它之外,rails 没有任何方法可以了解 apache 别名。

请记住,rails 也可以通过其他 Web 服务器运行。

为什么不能将 ckfinder 安装在 Rails 应用程序的“公共”目录中,以便始终可以相对于应用程序找到它?

I don't believe there's any way for rails to know about apache aliases other than by reading an apache config file and interpreting it yourself.

Remember, rails can be run through other web servers too.

Why can't you just have ckfinder installed in the "public" directory of your rails app so it can always be found relative to the app?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文