【问题标题】:yii2 localurls - language appended at the end of the urlyii2 localurls - 附加在 url 末尾的语言
【发布时间】:2023-03-30 12:48:01
【问题描述】:

我正在使用 Yii2 和扩展 localurls

我已按照说明进行操作,但似乎语言被附加到 URL 的末尾而不是脚本名称之前:

http://localhost/yii/advanced/frontend/web/index.php/en

另外,我尝试禁用“showScriptName”选项和 URL:

http://localhost/yii/advanced/frontend/web/en

未找到 -> 404 未找到。为什么会这样?

谢谢

【问题讨论】:

    标签: php yii2 yii2-extension


    【解决方案1】:

    你应该启用漂亮的网址。

     ...
    'urlManager' => [
        ...
        'enablePrettyUrl' => true,
        ...
    ]
    ...
    

    您的网络服务器配置中还应该有正确的重写部分。

    【讨论】:

    • 我已经这样做了,我得到了 404 错误,就像我说的那样。我不明白为什么
    • 谢谢!得到答案!
    • 谢谢;) 回答后我明白是你的问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-16
    • 2012-06-20
    • 2011-08-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多