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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -