Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
htaccess rewrite to reverse subfolders

As basic as it gets, here is an example of what I'm trying to do: enter image description here

I have a structure that takes different types of CMS' and inside each of those installations, are language variations.

By default the structure looks like this: https://[domain]/[country]/[installation]/[language-code]

Ultimately, I'm trying to get this:

https://[domain]/[country]/[language-code]/[installation]/

I'm wondering if this can be accomplished, due to the fact the folders/languages themselves are not actual folders and in fact rewrites from the CMS' settings (within the subfolders).

As unmodified these would be examples of the current urls:

https://example.com/ca/events/en/
https://example.com/ca/store/en/
https://example.com/ca/network/en/

And example of the desired results:

https://example.com/ca/en/events/
https://example.com/ca/en/store/
https://example.com/ca/en/network/

and for each installation, they dont always have the same languages (eg. ca has en and fr, but us has en and es)

Note: subsequent pages would be appended... eg: https://example.com/ca/en/events/event-name/subpage/

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You may be be able to use this single redirect rule on top of your .htaccess:

RewriteEngine On

RewriteRule ^([a-z]{2})/(.+)/([a-z]{2}/?)$ $1/$3/$2 [L]
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda