Issue
I've set my document root as follows:
c:/wamp/www/laravel/public
When I test localhost on the browser I get the "You have arrived" page.
However when I try localhost/page0, I get a 404.
In my routes.php file I have this:
Route::get('/', function()
{
return View::make('hello');
});
Route::get('page0', function() {
return 'Test Helloworld! 0';
});
My .htaccess file looks like this:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
It looks like everything should work. Why doesn't this work?
Solution
You might want to check if mod_rewrite is enabled by doing:
phpinfo();
You can issue this in your routes.php
.
It is also possible to start a webserver in php like so from the terminal or command prompt depending on your OS:
php -S localhost:8080 -t public/
Do this from your project root. Then you can go to:
localhost:8080
And your site should be up and running. You can still use the MySQL server that is running from XAMPP or WAMPP.
Answered By - sidneydobber Answer Checked By - Timothy Miller (WPSolving Admin)