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

147
Vistas
How to include a string in my website url?

I created a shop and the url is like:
https://myshop.com

But my client asked me to add respective salers' id into the url so that they can do some analyses, so it would look like:
https://saler001.myshop.com

I don't know where should I start to do this trick, maybe something in the DNS settings? Currently I've suggested them using url query string, but they don't accept.

btw, this shop is on Shopify.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You can parse the URL with the URL constructor, get the host name, then split it by a comma to get the subdomain.

const url = "https://saler001.myshop.com" //URL can be retrieved via `document.URL`

const id = new URL(url).hostname.split('.')[0].substr(5)
console.log(id)

about 4 years ago · Juan Pablo Isaza Denunciar

0

If you use Nginx, I think change vhost file can do it. (Apache also can do)

like there:

server {
    server_name ~^(?<name>\w+)\.myurl\.com$;

    location /admin {
        return 301 $scheme://www.myurl.com/sub=$name;
    }
}

If you can't change "HTTP proxy server", MUST check subdomain not work. if not work (find any subdomain will goto "www" your site), use @Spectric answer is right.

otherwise the "sub.google.com" only goto "sub.google.com" site, and not "www.google.com" / "google.com" site.

in there, you must use "Server API" check from site and do shop work, use like PHP or GoLange, etc.

about 4 years ago · Juan Pablo Isaza 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