ASP code Implementation of 301 redirect and with parameter method

Source: Internet
Author: User
Tags servervariables

Because of the need for revision, a section of the fire net needs to do 301 redirects, this is a long time ago the fire under the navigation of a search, using the ASP language, but spiders like, so can not delete, had to write a 301 redirect, but the original many URLs are parameters, such as tag tag, Form such as: Liehuo_tag.asp?q=%c1%d2%bb%f0%cd%f8.

Studied a bit, to solve the 301 redirect belt parameters of the problem, special to share with you, welcome friends to support the fire network more.

The code is as follows:

<%
if request. ServerVariables ("http_host") = "Liehuo.net" Then
if Request.ServerVariables ("Query_string") <> "" Then
p= "?"
response.status= "Moved Permanently"
Response.AddHeader "Location", "http://www.veryhuo.com" &request.servervariables ("Script_name")

&p&request.servervariables ("Query_string")
Response.End
Else
response.status= "Moved Permanently"
Response.AddHeader "Location", "http://www.veryhuo.com/"
Response.End
End If
End If
%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.