My Routes:
Get().route('/amp/@website', 'PageController@amp_info').name('amp_info'),
Get().route('/@website', 'PageController@info').name('info')
This works: https://websiteopedia.com/www.eventsnow.com this does not https://websiteopedia.com/https://www.eventsnow.com/
What do I need to do differently? the slash in params redirected to the 404 as it didn't find any matching route
Yes, in order to achieve this you have two options: using inputs or creating a route compiler
Using Inputs
You can make the url simply go to the
infomethod with nothing special in the url:Then you can hit routes like
https://websiteopedia.com/?website=https://www.eventsnow.com/Then inside the
infomethod, you would get the input as normal:Route Compiler
A route compiler is simply a way to compile regex in the URL. You can make a new compiler in one of the boot methods in your service providers.
This new compiler would look like this:
Then you can construct the route like this:
This will now compile that into the regex you provided and you can now hit the routes like you were previously.