Apache:
Options+FollowSymLinksRewriteEngineonRewriteRule(.*)
/$1
HTML:
<metahttp-equiv=”refresh”content=”0;url=/”>
JavaScript:
<scriptlanguage=”javascript”>top.location=’/’;</script>
ASP:
<%Response.AddHeader”Location”,”/”Response.End%>
:
<%@PageLanguage=”C#”%><scriptrunat=”server”>protectedvoidPage_Load(objectsender,EventArgse){HttpContext.Current.Response.AddHeader(“Location”,/);}</script>
PHP:
<?phpheader(“Location:/”);exit();?>
Perl:
$q=newCGI;print$q->redirect(“/”);
Pyton:
fromdjangoimporthttpdefview(request):returnhttp.HttpResponseRedirect(‘/’)
看网站程序选择代码