PHP built in server and .htaccess mod rewrites

前端 未结 2 1445
面向向阳花
面向向阳花 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:58

    It is not possible to handle .htaccess using PHP's built-in webserver (it is not relying on apache, it is implemented entirely in PHP's core). However, you can use router script (described here: http://php.net/manual/en/features.commandline.webserver.php).

    E.g. php -S localhost -S localhost:8080 router.php

提交回复
热议问题