【问题标题】:Rewrite of NGINX to Laravel 5 in an online host在在线主机中将 NGINX 重写为 Laravel 5
【发布时间】:2015-10-08 06:41:56
【问题描述】:

我想知道在线主机中 Nginx 服务器的配置文件的路径,以便从 URL 中删除 index.php。

对于前http://site/public/index.php/more 应转换为http://site/more

【问题讨论】:

    标签: php laravel nginx url-rewriting laravel-5


    【解决方案1】:

    在 Nginx 上,站点配置中的以下指令将允许“漂亮”的 URL:

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
    

    http://laravel.com/docs/5.0/installation#pretty-urls

    【讨论】:

    • 这是你设置宅基地时的默认设置。
    猜你喜欢
    • 1970-01-01
    • 2013-03-19
    • 1970-01-01
    • 2018-03-20
    • 1970-01-01
    • 1970-01-01
    • 2013-03-13
    • 2012-03-05
    • 1970-01-01
    相关资源
    最近更新 更多