0

I'm trying to pass an url to a controller.

http://something/index.php/api/http%3A%2F%2Fengadget.com

I get 404 Not Found error.

My route

Route::any("/api/{url}", "ApiController@parse");

How do I configure a route or controller to make it work?

1
  • Are you using Laravel 3 or 4? Commented May 18, 2013 at 3:38

2 Answers 2

1
Route::any("/api/(:all)", "ApiController@parse");

http://laravel.com/docs/routing#wildcards

You use (:all) to catch the rest of the URI

Sign up to request clarification or add additional context in comments.

3 Comments

Nope, doesn't work. As I mentioned, it's not even hitting the route. I get 404 not found.
beside that, {url} or {anystringhere} is completely valid as far as I know.
If you're using Laravel 3, it should be api@parse instead. You used both tags so I'm not sure if you're using L3 or L4.
0

How about without the / in front of "api"?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.