重写/public绝对不是更改文档根目录的正确方法 [英] Rewriting to /public is absolutely not the right way to change the document root

查看:101
本文介绍了重写/public绝对不是更改文档根目录的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过阅读后,我发现Azure实际建议运行Laravel(以及任何其他不在根项目结构之外的主机)应用程序的人使用mod_rewrite重写请求以指向"/public".

After doing some reading, I'm seeing Azure actually suggesting to people running Laravel (and any others that don't host out of the root project structure) applications to use mod_rewrite to rewrite requests to point to "/public".

这是一个绝对荒谬的建议,实际上是您可以提供的一些最糟糕的建议.强迫人们使用"/public"的网址结构中,因为你们没有花时间研究最低限度的配置 您提供的产品的选项绝不可接受.

This is an absolutely ridiculous suggestion and is effectively some of the worst advice you could give.  Forcing people to have "/public" in their URL structure because you guys didn't take the time to research the bare-minimum configuration options for your offering is not in any way acceptable.

我建议您紧急添加对配置文档根目录功能的支持.使用mod_rewrite(.htaccess)的建议不仅无效,而且通过托管项目根目录实际上违反了安全性最佳实践.是的我明白 重写在那里,但是由于.htaccess的性质,这种方法存在无数问题.

I suggest you urgently add support for the ability to configure the document root.  Not only is the suggestion to use mod_rewrite (.htaccess) a cop out, but it actually violates security best practices by hosting your project root.  Yes, I understand the rewrite is there, but there are countless issues with this methodology, due to the nature of .htaccess.

Laravel中以这种方式运行的公共目录是设计使然,而不是要颠覆的东西.

The public directory in Laravel functioning this way is by design and not something to be subverted.

推荐答案

我看到您已经提出了

I see that you have already raised a feedback item on this request. Thank you for providing your valuable feedback on this functionality- All of the feedback you share in these forums will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure.

如果您不希望使用.htaccess重写并且符合您的要求,那么从今天起,您可以使用 自定义Docker镜像.在我内部检查此反馈时,请告诉我们这对您的工作原理.

If you don’t wish to use .htaccess rewrite and your requirement fits, as of today you can deploy your Laravel application with a custom Docker image instead. Let us know how this works for you while I check on this feedback internally.


这篇关于重写/public绝对不是更改文档根目录的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆