Apache: Redirections

De Wiki.

Aller à : Navigation, rechercher
(Page créée avec « === Rediriger tout en HTTPS === <syntaxhighlight lang='apache'> RedirectMatch permanent / https://monsite/ </syntaxhighlight> === Rediriger tout en HTTPS, sauf une URL === <... »)
Ligne 1 : Ligne 1 :
-
=== Rediriger tout en HTTPS ===
+
=== Rediriger tout en HTTPS, sur la racine ===
 +
 
 +
Exemple: http://monsite.com/toto -> '''https'''://monsite.com/
<syntaxhighlight lang='apache'>
<syntaxhighlight lang='apache'>
RedirectMatch permanent / https://monsite/
RedirectMatch permanent / https://monsite/
Ligne 7 : Ligne 9 :
<syntaxhighlight lang='apache'>
<syntaxhighlight lang='apache'>
RedirectMatch permanent ^/(?!server-status) https://monsite/
RedirectMatch permanent ^/(?!server-status) https://monsite/
 +
</syntaxhighlight>
 +
 +
=== Rediriger tout sur un autre site, en conservant les URIs ===
 +
Exemple: http://monsite.com/toto -> http://'''monautresite.com'''/toto
 +
<syntaxhighlight lang='apache'>
 +
RedirectMatch permanent (.*) http://monautresite.com/$1
</syntaxhighlight>
</syntaxhighlight>
[[Catégorie:Apache]]
[[Catégorie:Apache]]

Version du 12 juillet 2011 à 13:25

Outils personnels
Espaces de noms
Variantes
Actions
Navigation
Liens
Boîte à outils