Hello people here is my code below for laravel routes.php
Route::get('/', function()
{
return View::make('index');
});
Route::get('bid', function()
{
return View::make('bid');
});
this works fine for http://localhost/supadmin/public/
but does not work for http://localhost/supadmin/public/bid
,, what could be the problem?? Iam getting an error The requested URL /supadmin/public/bid was not found on this server.
i have also configured .htaccess
to
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
It works fine like this http://localhost/supadmin/public/index.php/bid
but iam expecting it to work http://localhost/supadmin/public/bid
php artisan routes
shows
+--------+--------------------------+-------------+---------+----------------+---------------+
| Domain | URI | Name | Action | Before Filters | After Filters |
+--------+--------------------------+-------------+---------+----------------+---------------+
| | GET|HEAD / | | Closure | | |
| | GET|HEAD bid | | Closure | | |
| | GET|HEAD bid_history | bid_history | Closure | |
You need to put /bid
Route::get('/bid', function()
{
return View::make('bid');
});
Please make sure routes are registered by using php artisan routes
and try it serving through php artisan serve
Edit
You should also try checking your apache setting
add the following code to /etc/apache2/sites-available/default
AllowOverride All
Restart apache
The order is wrong. Try this:
Route::get('bid', function()
{
return View::make('bid');
});
Route::get('/', function()
{
return View::make('index');
});
You need to enable the Apache module mod_rewrite
.
To enable mod_rewrite:
a2enmod rewrite
Then restart Apache:
service apache2 restart