<%@ Page Language="VB" %>
<script runat="server">
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", "http://www.example.tld")
Response.End()
</script>
en C#
<script>
private void Page_Load(object sender, System.EventArgs e) {
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.example.tld");
}
</script>
en VB
<%
private sub Page_Load(object sender, System.EventArgs e)
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location","http://www.example.tld")
end sub
%>
<%@ Page Language="VB" %>
<%
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", "ttp://www.example.tld")
%>
# From http://example.tld to http://www.example.tld
RewriteCond Host: (?!www\.)(.+)
RewriteRule (.+) http\://www.$1$2 [I,RP]
kasperle a dit:Donc le code qui marche dans mon cas est
Code:<%@ Page Language="VB" %> <% Response.Status = "301 Moved Permanently" Response.AddHeader("Location", "ttp://www.example.tld") %>
Ca marche, bonne rédirection avec un header 301.
kasperle a dit:En faite, il suffit d'enlever le ReponseEnd pour qu'il marche. Avec ReponseEnd ça ne marche pas sur ASP3, en tout cas moi il me donnait une erreur.