asp/asp.net/php实现301重定向代码,一般我们做301是全用iis,apache来实现,在没有操作服务器的时我们再用脚本来实现,代码如下.
1、asp下的301重定向代码
- <%@ language=vbscript %>
- <%
- response.status=”301 moved permanently”
- response.addheader “location”, “106/”
- %>
2、asp.net下的301重定向代码
- <script runat=”server”>
- private void page_load(object sender, system.eventargs e)
- {
- response.status = “301 moved permanently”;
- response.addheader(”location”,” 106/“);
- }
- </script>
3、php下的301重定向代码
- header(”http/1.1 301 moved permanently”);
- header(”location: 106/”);
- exit();
|