Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Application templates: missing .htaccess #2800
IMO app templates should contain .htaccess file configured for this:
'components' => [ 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, ], ]
So we get out-of-box working routing for Apache HTTPD.
There is, of course, one downside to .htaccess, it is slow. That is why, on the Apache server we do have, it isn't used since it has to perform a new directory scan every single time, every single request.
I kind of agree with the current setup, adding commented out line to the main.php config for the pretty URLs directing the user to a help page about it.
for develop by native build-in server inside php
and add in index.php
so you can enable suffix in urlManager
otherwise, you can copy a index-dev.php for develop.
I wouldn't say it is best practice; the built in PHP server is meant for light testing only, it is not designed to replicate a production environment where either Lighttpd/Nginx or Apache would run.
It is one way of doing it but I wouldn't affirm it is best practice unless you can quote the PHP documentation on it?