Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

252
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda