0
votes

everyone. Need a bit of help here.

I'm setting up a Laravel project(5.2), inside Laravel's /public folder i have created a /public/blog.

If i access example.com/blog/ - it works fine and returns the blog's home page.

But if i click any article inside the blog, the url is example.com/blog/article_name/ -- This gives an error. It's 404 page/route not found error from Laravel.

Any help would be great, Thank you.

2
@recovery thank you, tried. Same error. - Shavkat

2 Answers

0
votes

you want to define the route in /routes/web.php

Route::get('/blog/{name}');
0
votes

I think Route Parameter helps you.

Sometimes you will need to capture segments of the URI within your route. For example, you may need to capture a user's ID from the URL. You may do so by defining route parameters:

Route::get('user/{id}', function ($id) {
    return 'User '.$id;
});

In the same way you can use article name.