OVH Cloud OVH Cloud

Domain RewritePath

1 réponse
Avatar
Luis
Hi, I'm a new user on this forum.
I have a domain www.MyDomain.org that is redirected to
www.AnotherDomain.net/MyDomain/
So if somebody types www.MyDomain.org/anypage.aspx it gets the correct page
automatically at www.AnotherDomain.net/MyDomain/anypage.aspx.
The problem is that the latter address is shown in the address bar and also
search robots don’t have the reference to the “official” address.
I would like to have the asp.NET 2.0 server I use, to rewrite the page URL
before sending it to the client’s browser in the form
www.MyDomain.org/anypage.aspx (as said, I already have automatic redirection
to the physical site).
This will involve a further redirection for each visited page to the
physical real one; I don’t think it’s a problem.
I know asp.NET offers URL RewritePath method feature, but it seems only to
apply to the relative internal paths, not to the domain part of the address.
Is there any way to do what I need ?
Many thanks for your help: I’m completely newbie in asp.NET!

1 réponse

Avatar
Luis
Bonjour,
Je n’ai pas trouvé la méthode pour éditer mon Message et y rajouter la
traduction en français, c’est pour cela que je vais le reposter.
J’ai un domaine du type www.MonDomaine.org qui est redirigé vers
www.UnAutreDomaine.net/MonDomaine
Donc si quelqu'un tapes www.MonDomaine.org/unepage.aspx il obtient
automatiquement la bonne page à l’adresse www.UnAutredomaine.net/unepage.aspx.
Le problème est que cette dernière adresse (« physique ») est montrée dans
la barre d’adresse, et également les moteurs de recherche ne tiennent pas
compte de l’adresse « officiel » mais seulement de celui « physique ».
Je voudrais que mon serveur asp.NET 2.0 (j’utilise un serveur virtuel)
puisse réécrire l’adresse de chaque page avant de l’expédier au navigateur du
Client, avec utilisation de mon domaine « officiel » du type
www.MonDomaine.org/unepage.aspx (car comme j’ai dit j’ai une redirection
automatique pas DNS vers le serveur « physique », donc la boucle serait
bouclé).

Cela comporte que pour chaque page du site mon redirection de DNS entre en
jeu, mais cela je ne crois pas soit un problème (de rapidité ou autre).

Je sais que la méthode RewritePath d’asp.net fait quelque chose de
similaire, mais elle semblerait ne s’appliquer qu’à la partie « interne » de
l’adresse, relative au domaine, et qu’on ne puisse pas l’utiliser pour
changer également la partie correspondante au domaine lui-même.

Existe-t-il une méthode pour obtenir ce que je demande ?
Asp.net semble pouvoir manipuler tout type de données et entêtes avant de
l’expédier au navigateur du Client, donc pourquoi pas le domaine ?

Je suis complètement bouveau à asp.net, et je vous remercie d’avance pour
vos indications.



"Luis" a écrit :

Hi, I'm a new user on this forum.
I have a domain www.MyDomain.org that is redirected to
www.AnotherDomain.net/MyDomain/
So if somebody types www.MyDomain.org/anypage.aspx it gets the correct page
automatically at www.AnotherDomain.net/MyDomain/anypage.aspx.
The problem is that the latter address is shown in the address bar and also
search robots don’t have the reference to the “official” address.
I would like to have the asp.NET 2.0 server I use, to rewrite the page URL
before sending it to the client’s browser in the form
www.MyDomain.org/anypage.aspx (as said, I already have automatic redirection
to the physical site).
This will involve a further redirection for each visited page to the
physical real one; I don’t think it’s a problem.
I know asp.NET offers URL RewritePath method feature, but it seems only to
apply to the relative internal paths, not to the domain part of the address.
Is there any way to do what I need ?
Many thanks for your help: I’m completely newbie in asp.NET!