http://www.ford.com/page.asp?model=explorer&year=1999A more presentable way of rewriting the URL might be:
http://www.ford.com/explorer/1999/It used to be that search engines would not index pages with querystrings (the information after the .asp? in the URL). These days this is not the case and most search engines do index these types of pages. However, it has been suggested that major search engines might not be able to use more than three querystring parameters.
strQuery = Request.ServerVariables("QUERY_STRING")You need to modify it a little. Change all of the page.asp and page2.asp to your own page names and add more of these lines if necessary. And add a custom error message after the Else line so that normal errors are still display when needed.
strPage = Mid(strQuery, InStrRev(strQuery, "/") + 1)
' Change page.asp and page2.asp and add duplicate lines for
' each page you want redirection
If strPage = "page.asp" Then
ElseIf strPage = "page2.asp" Then
'Put your normal error page here
Function RequestQS(strParam)Then in your scripts, instead of using the usual request/request.querystring/etc to retrieve your paramaters, use RequestQS(param-name).
strQuery = Request.ServerVariables("QUERY_STRING")
lngStart = InStr(strQuery,"/" & strParam & "/")
RequestQS = ""
If lngStart > 0 Then
lngStart = lngStart + Len("/" & strParam & "/")
lngEnd = InStr(lngStart + 0, strQuery, "/")
If lngEnd > 0 Then
RequestQS = Mid(strQuery, lngStart, lngEnd - lngStart)
http://www.mydomain.com/param1name/param1value/param2name/param2value/page.aspYou can then request the values of param1name, param2name etc by using RequestQS. (NB. You can include as many parameters as you need.)
http://www.ford.com/page.asp?model=explorer&year=1999A more presentable way of rewriting the URL using subdomains might be:
http://explorer.1999.ford.com/page.aspThis, of course, would depend on whether your hosting company allowed wildcard subdomains.
strServer = lcase(Request.ServerVariables("SERVER_NAME"))You need to add (or include) this to the beginning of each script that you want to use the subdomain(s) as parameters. Make sure you change mydomain.com to your own domain name (don't include any http:// or www.) and duplicate the line for any additional domain names that might also be used.
' Change mydomain.com to your domain name and duplicate
' this line for additional domain names
strServer = Replace(strServer, "mydomain.com", "")
If strServer = "" Then strServer = "."
strParams = Split(strServer, ".")
If intParam > UBound(strParams) Then
RequestSD = ""
RequestSD = strParams(intParam)
To receive email notifications when this blog is updated, subscribe by entering your email address below.