ich auf bestimmte URL in Laravel umleiten müssen, wenn die URL beginnt mit Inhalt oder Video oder Bild oder Videos oder Bilder oder etc ...wenn URL beginnt mit xyz in Laravel
Ich habe dies geschrieben Konzept in einfachen PHP, aber wie das in Laravel geschrieben werden kann.
redirect.php
<?php
if(isset($_GET['name']))
{
$link = $_GET['name'];
$request = parse_url($link);
echo $request["path"];
}
?>
.htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} /content/ [OR]
RewriteCond %{REQUEST_URI} /videos/ [OR]
RewriteCond %{REQUEST_URI} /video/ [OR]
RewriteCond %{REQUEST_URI} /contents/ [OR]
RewriteCond %{REQUEST_URI} //contents/
RewriteRule .* http://localhost/redirect.php?name=http%1://%{HTTP_HOST}%{REQUEST_URI} [R,QSA,B]
Beispiele
http://localhost:8048/content/23423/nice-up-civic-poll.html
http://localhost:8048/video/43432/something-here.html
http://localhost:8048/videos/2354323/good-nice.html
http://localhost:8048/contents/451425/breakup-actor.html
http://localhost:8048/content/time/451425/breakup-actor.html
http://localhost:8048/video/watch/1233456/accident-occured.html
können Sie eine Beispiel-URL für diesen Fall –
@DhavalChheda die Frage aktualisiert schreiben – Sharath
Nun, was haben Sie versucht? Was Sie wollen, ist alles in der Dokumentation geschrieben. – Jeffrey