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

253
Visualizações
How to 301 Permanent Redirect a Website to a Subcategory of Another Website and Permalinks (Using .htaccess)

How should I edit .htaccess file so that my Site is redirected permanently (301) to a subcategory of another website in this way,

Structure:

SiteA.com -----> SiteB.com/category/abc (Rule301) SiteA.com/samplepost ------> SiteB.com/samplepost (Rule 301)

I and new and I need to move a site in such a way that the base URL redirects to a subcategory of another website and all the permalinks redirected to another website as usual structure.

If someone can please make give me custom code for this type of redirection. I couldn't find any thing related to this and I am a beginner.

Thankyou.

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

0

Sounds pretty straight forward, you surely could have implemented that yourself:

RewriteEngine on

RewriteRule ^/?$ https://B.example.com/category/abc [R=301,L]

RewriteRule ^ https://B.example.com%{REQUEST_URI} [R=301,L]

If both hosts are served from the same http server you need to be more specific:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^A\.example\.com$
RewriteRule ^/?$ https://B.example.com/category/abc [R=301,L]

RewriteCond %{HTTP_HOST} ^A\.example\.com$
RewriteRule ^ https://B.example.com%{REQUEST_URI} [R=301,L]

You obviously need the rewriting module to be loaded into the http server serving site "A.example.com".

In general it makes sense to implement such rules in the actual http server's host configuration. If you have no access to that you can also use a distributed configuration file for that (".htaccess"), but that comes with a few disadvantages. Above rules will work likewise.

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