dqy13020940 2017-11-05 05:23
浏览 28
已采纳

Klein PHP路由器 - 无法让它工作

i'm tryin to use Klein for some routing on my test webapp.

I have mod_rewrite enabled and that's my htaccess.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

I'm using their Hello World example, but i get a 404 when i type 'localhost/mysite/hello-world'.

Can you help me? Thanks!

  • 写回答

1条回答 默认 最新

  • douzhan1963 2017-11-05 07:28
    关注
    1. Read the manual about this topic:

    Sub Directory Installation: https://github.com/klein/klein.php/wiki/Sub-Directory-Installation

    1. Option: You can try to run it with PHP's built-in webserver:

    $ cd [my-app-name]; php -S localhost:8080 -t public public/index.php

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部