【问题标题】:Is there a way remove index.php in Laravel without changing .htaccess有没有办法在 Laravel 中删除 index.php 而无需更改 .htaccess
【发布时间】:2017-11-06 21:18:05
【问题描述】:

在我们的生产服务器中,出于某些安全原因,他们有 disabled .htaccess 文件加载到 apache 配置中,因此所有 URL 都添加了 index.php补充。

问题 图像 urlcurl 请求 无法正常工作,因为除了 url 还添加了 index.php。

有没有其他方法可以做到这一点。即使我更正了 CURL 请求它也会帮助我。

【问题讨论】:

    标签: php apache laravel .htaccess


    【解决方案1】:

    您可能需要检查是否有DirectoryIndex 配置添加到您的生产服务器的虚拟主机配置中。如果没有尝试添加以下内容:

    DirectoryIndex index.php index.html
    

    【讨论】:

    • 我删除了答案中暗示不使用 htaccess 的文本。但是,您可以尝试将 htaccess 内容添加到您的虚拟主机配置文件中。这可能会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-08
    • 1970-01-01
    • 2020-06-11
    • 2021-02-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多