I have a route defined as follows:
Route::get('products/{name}', function($name) {
return View::make('product')->with('name', $name);
});
The problem is that when this route is used, the current directory is changed to example.com/products/
which is horrendous, as that completely breaks the links (an image that pointed to images/nameOfImage.png
now points to products/images/nameOfImage.png
, which doesn't exist).
How can I prevent this?