I’ve changed links on website a little bit so it’s more SEO friendly for our international sites, so I simply translated word “game” and links are now like:
domain.com/games/id-123
domain.pl/gry/id-123
domain.de/spiele/id-123
Previously website links were like:
domain.com/games/id-123
domain.pl/games/id-123
domain.de/games/id-123
Now I want to make apache 301 redirect so links from other websites, google, etc will be redirect to new addressses:
domain.pl/games/id-123 -> domain.pl/gry/id-123
domain.de/games/id-123 -> domain.de/spiele/id-123
I need to add that of course “id-123” is and id of a game, so its “dynamic” and I can’t make simple redirect like “Redirect 301 /gry/ domain.com/spiele/”.
Use mod_rewrite and
%{HTTP_HOST}to match the appropriate domain in aRewriteCond, and route accordingly: