Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

redirection url et sous domaine

2 réponses
Avatar
Nicolas Ménard
Bonjour,

Comment rediriger un sous domaine vers une URL classique :

Exemple :
http://admin.domaine.com => http://www.domaine.com/admin/

Cette opération peut elle se faire au niveau des DNS ?

Merci pour votre aide
@+
Nicolas

2 réponses

Avatar
Annie D.
"Fontaine.Sebastien" wrote:

Comment rediriger un sous domaine vers une URL classique :

Exemple :
http://admin.domaine.com" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://admin.domaine.com => http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/

Cette opération peut elle se faire au niveau des DNS ?


Cette opération ne peux pas s'effectuer au niveau du DNS. Tu peux créer une
page de redirection (non visible par le user) sur le site admin.domaine.com.


DNS peut réaliser la première partie de l'opération, par exemple en
faisant pointer un CNAME admin.domaine.com vers www.domaine.com. Ensuite
il faut configurer le serveur HTTP pour soit effectuer une redirection
d'URL, et l'URL final sera http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/, soit pour
gérer un "virtual host" admin.domaine.com et l'URL final reste
http://admin.domaine.com" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://admin.domaine.com mais offre le même contenu que
http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/" target="_blank" class="text-blue hover:opacity-90 " style="word-break: break-all;" rel="noopener nofollow">http://www.domaine.com/admin/. Le support du HTTP/1.1 est requis.

C'est ce qui est fait sur les serveurs web mutualisés de certains
FAI/FSI : accès au même contenu possible avec
http://perso.fai.tld/~user/ ou http://user.fai.tld/, ou encore n'importe
quel autre nom de domaine dont vous disposez, si le FAI est arrangeant
;o).


Avatar
Gils Gayraud

Exemple :
http://admin.domaine.com => http://www.domaine.com/admin/



Si votre serveur comprend le PHP
dns le répertoire admin.domaine.com
vous mettez un fichier index.php contenant

<?php
header( "Location: http://www.domaine.com/admin/" );
exit;
?>

--
Cordialement
GG.