I'm still trying things with Laravel 5.4. however running
php artisan server
is not taking .htaccess file in /public into consideration, no matter what i edit in there it's still not processing it, the artisan serve runs at 127.0.0.1:8000
--- i reached this issue cuz i was looking for one other thing which is:
i wanted to have a route::get for the /images folder which is already located at /public, removing -d from htaccess conditions should solve this normally, thus making apache redirect requests even from folders to index.php,
so while testing locally using php artisan serve i noticed that changes or even clearing the htaccess file does not change the behavior of laravel.
Thank you for your time.
[note] htaccess works if i run laravel from apache, or anything but php artisan serve. so my question is only about the serve command and it's behavior.
PHP has a basic web server feature. this server feature is what is used when you run php artisan serve
. .htaccess
is an Apache server feature not a PHP feature.
PHP is not built to be a full blown web server so it doesn't have all the configuration options you would find on say Apache or Nginx
you need to define it in the artisan config file!
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
As explained on https://laravel.com/docs/5.4/homestead (homestead is vagrant+)
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With