Support the ongoing development of Laravel.io →
posted 9 years ago
Architecture
Last updated 2 years ago.
0

You would have a redirector page like:

redirector/http://externalurl.com/

And then in the controller you either have an array of codes and the URLs they redirect to or use the external URL in the local one as per above.

function redirect($url) {
    return Redirect::to($url);
}
0

Hey beaverusiv,

Now I have arrived at an outcome that I was almost certain would unfold. I followed your sound advice and constructed the following route:

Route::get('/acm/{slug}', function( $slug ) {
	$publication = Publication::whereSlug($slug)->first();

	return Redirect::to($publication->download_link);
});

The intent of this is of course other pages linking to that 'redirecting' route. Unfortunately, this doesn't work. I arrive at the correct page on ACM's website, but their 'non authorized link detection code' apparently triggers as I am not allowed to download the article.

However - if I instead do this:

Route::get('/acm/{slug}', function( $slug ) {
	$publication = Publication::whereSlug($slug)->first();

	return '<a href="'. $publication->download_link .'">LINK TO PDF</a>';
});

Then clicking that link will work.

I'm generally not the type to circumvent protocol, but this is just silly. Any ideas for how I might bypass their silly detection schemes?

Regards, Gazoo

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Gazoo101 gazoo101 Joined 24 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.