My functionality is to check whether the requested image URL exists or not. If the image exists then generate a thumbnail and return that path, if not exists then return no-image image path.
I am trying to identify in .htaccess like
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(jpe?g|png)$ /generate-image [R,L=301]
After that in the generate-image route, I am trying to get that requested image URL
Route::get('/generate-image', function () {
echo $_SERVER['REQUEST_URI'];
// $request->fullUrl();
});
Here I am getting REQUEST_URI is generate-image instead of the original requested image URL. How to get that original requested image URL in the redirected page