4. Change vhost to make public folder as root directory
1 2 3 4
# Open /etc/apache2/sites-available/000-default.conf # append public to DocumentRoot # (Note: I already mv content from helloWorld folder to html folder) DocumentRoot /var/www/html/public
Now, we can access the website with http://YourIPAddress now.
5. Enable mod rewrite
1 2 3 4 5 6
# Open /etc/apache2/apache2.conf <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride all #Change None to all here Require all granted </Directory>
6. Test for mod rewrite
1 2 3 4
# Add below function to router.php Route::get('users', function() { return 'Users!'; });
Now open http://YourIPAddress/users, then you can see Users! in the web page.