Laravel quick start guide route not working
Seems like your Laravel app is accesible via an Apache HTTP alias, because your URL looks like: http://localhost/laravel/
. If this is the case and assuming that http://localhost/laravel
is pointing to your public directory, then follow these steps:
- Try to navigate to your expected route prepend it with
/index.php/
, in your case:http://localhost/laravel/index.php/users
. If it works (no 404) then you problem is with the Rewrite Module configuration of Apache HTTP, you should follow the next steps. - Edit the file
public/.htaccess
. - Under the line
RewriteEngine On
addRewriteBase /laravel/
. - Try to navigate to an existing route.
Basically, if you app resides in a alias or virtual directory (say http://localhost/alias
) you should add an entry in your rewrite rule to rewrite the base directory with alias
.
Laravel quick start example not run
in the folder you created the project could you run php artisan serve
and browse to localhost:8000
Laravel 5.2 quickstart guide gives Not Found Error
When you change your form action parameter to
/learninglaravel/laraquickstart/quickstart/public/task
You are going to make HTTP POST request to
{scheme}://{domain}//learninglaravel/laraquickstart/quickstart/public/task
So laravel is going to look for this route and obviously it won't find it.
Why my laravel routes tutorial is not working?
Try this
.htaccess file
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
#RewriteBase /~projectname/master/
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
Also Please try this
Route::get('/about', function () {
return view('pages.about');
});
Route::post('/about', function () {
return view('pages.about');
});
Laravel routing does not work even when my routes exist in route:list and I have tried route:clear and route:cache
You are using same URI route pattern, that's why its conflict with other route. My be its conflict with Route::get('/blog/{short_link}', 'BlogController@show');
or Route::get('/blog/keyword:{keyword}', 'BlogController@filterByKeyword');
because all these routes URL Pattern are same
Laravel project routes not working when app is accessed over the network
The apache virtual host should point to the public
directory for your laravel project.
e.g.
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www/public"
<Directory "${INSTALL_DIR}/www/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Related Topics
Execute a PHP Script from Another PHP Script
Php's File_Exists() Will Not Work for Me
How to Remove Empty Paragraph Tags from String
How to Set Current Page "Active" in PHP
How to Break an Outer Loop with PHP
Finding Free Blocks of Time in MySQL and PHP
Basic Simplexml Working Example
PHP Auto-Kill a Script If the Http Request Is Cancelled/Closed
Php: Date Larger Than Current Date
How to Use Two Submit Buttons, and Differentiate Between Which One Was Used to Submit the Form
Check If Laravel Model Got Saved or Query Got Executed
How to Send Cookies with File_Get_Contents
"Class Xxx Is Not a Valid Entity or Mapped Super Class" After Moving the Class in the Filesystem
PHP Array VS [ ] in Method and Variable Declaration
PHP Type-Hinting to Primitive Values
How to Show Ajax Loading Gif Animation While the Page Is Loading