regex - How to rewrite specific urls from using mod_rewrite? -
i have different languages' sites mydomain/en/mobile, mydomain/de/mobile etc. new mobile websites coming , url has changed f.x. /en/mobile /mobile/en etc., want redirect first few pages, , later new link. have such rule implemented single language , works :
rewriteengine on rewritecond %{request_uri} ^/en/mobile/(.*)$ rewriterule (.*) https://%{http_host}/mobile/en [l,r=301]
now need 2 rules - 1 redirect languages , 1 redirects few of them - f.x. en/de/fr should redirected others shouldn't be.
that worked me
rewriterule ^/(en|de|fr)/mobile(.*)$ https://%{http_host}/mobile/$1 [l,r=301]
Comments
Post a Comment