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

90
Vistas
Server Redirect With Ports?

I don't have much experience with Apache or servers, so my apologies if this is a stupid question. I am trying to redirect http://example.com:5557 to http://203.0.113.111:5557. Is this something I can do in the .htaccess file and, if so, what would that look like?

Here is my idea:

Redirect 301 "http://example.com:5557" "http://203.0.113.111:5557"
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Yes, you can do this in .htaccess, but not with the mod_alias Redirect directive. The Redirect directive matches against the URL-path only. You need to match against the HTTP Host request header, which contains the hostname + port number.

Try the following using mod_rewrite instead:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^example\.com:5557$ [NC]
RewriteRule ^$ http://203.0.113.111:5557/ [R=301,L]

Note that this redirects the document root (homepage) only, as stated in your example. If you need to redirect any URL to the same URL at the target domain then use the following RewriteRule instead:

:
RewriteRule ^ http://203.0.113.111:5557%{REQUEST_URI} [R=301,L]

NB: Test first with 302 (temporary) redirect to avoid potential caching issues.

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