I have been spending hours on this issue and hope to find my way out. I have set up laravel correctly, created a project myapp
My route.php file just contains
Route::get('/', function()
{
return View::make('hello');
});
Route::get('/users', function()
{
return 'Users!';
});
When I run
http://localhost/myapp/public/
I get the laravel start page correctly
When I run
http://localhost/myapp/public/users
I get
The requested URL /myapp/index.php was not found on this server.
I don't know why its looking for index.php.
When I run
http://localhost/myapp/public/index.php/users
I get a page with text "Users". I should obtain this page when running
http://localhost/myapp/public/users
instead.
Below is my .htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
Rewritebase /myapp/
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Any ideas? Am running a Apache on Linux.
Your RewriteBase
is set to /myapp/
but your index.php file is in /mayapp/public/
is it not?
As such, I think you'll find the RewriteBase
needs to be /myapp/public/
.
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