PHP built in server and .htaccess mod rewrites

前端 未结 2 1448
面向向阳花
面向向阳花 2020-11-30 01:24

Does PHP\'s built in server not make use of .htaccess? Makes sense, I suppose, as it isn\'t relying upon Apache(?). Anyway, is it possible to tell the server to make use of

2条回答
  •  忘掉有多难
    2020-11-30 01:35

    Here's the router that I use for the builtin php webserver that serves assets from the filesystem if they exist and otherwise performs a rewrite to an index.php file.

    Run using:

    php -S localhost:8080 router.php
    

    router.php:

提交回复
热议问题