asp scripts


This assumes your default file is default.asp. If it is not default.asp, then you will need to change it. This is important to prevent endless looping.

Change example.com on line 7 to your domain name. This will do a permanent redirect to the non-www version of your domain. Place this at the top of your file.

<%
PATH_INFO = lcase(Request.servervariables(”PATH_INFO”))
if PATH_INFO = “/default.asp” then
PATH_INFO = “”
end if
HTTP_HOST = lcase(Request.servervariables(”HTTP_HOST”))
if instr(HTTP_HOST, “www.”) = 1 then
newurl = “http://example.com” & PATH_INFO
Response.Status = “301 Moved Permanently”
Response.AddHeader “Location”, newurl
Response.End
end if
%>

So why would I want to do this?

  1. If you prefer to use the non-www version of your site. (http://example.com)
  2. Consistent URL referencing is a basic key to good SEO (search engine optimization).

Free ASP Image Gallery

MS Access Logging

Event Log Monitoring

ASP News System

Instant Content Management

ASP Guest book

Software Review Website

MySQL ASP Content Management MySQL ASP Content Management

ASP Content Management ASP Content Management

Content Management Music Review Content Management Music Review

Content Management Movie Review Content Management Movie Review

Website Monitoring Website Monitoring Script


Submit ASP Script