Htaccess -Umleitung basierend auf einem Teil der URL

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Htaccess -Umleitung basierend auf einem Teil der URL

by Guest » 24 Feb 2025, 04:29

Ich versuche, eine URL, die API < /code> zu einem anderen enthält, umzuleiten.
Beispiel: < /p>

Code: Select all

OLD: https://old-domain/api/lalala
REDIRECT: https://new-domain/api/lalala
< /code>
Was ich nicht umleiten darf: < /p>
https://old-domain/lalala
< /code>
Was ich versuche, ist < /p>
RewriteEngine On
RewriteBase /

#Tried this one
#RewriteRule ^https://old-domain/api/(.*)$ https://new-domain/api/$1 [L,R=301]

#And this one
RedirectMatch 301 costercatalog.com/api/(.*) https://new-domain/api/$1
Tests im HTaccess -Tester, aber die Regel stimmt nicht überein.

Top