Web redirection and "cloaking" with ASP script

Some ISPs offer "web redirection" service, where they will redirect web-requests for your domain name to another website. For example from www.myname.com to www.ispname.com/~myname or from www.myname.com to myname.ispname.com.

You can do simple redirection with CNAME (alias) DNS records, but this does not work if you need to redirect to a sub-directory (like the first sample above), or if the destination web-server is using virtual hosting (multiple domain names on the same IP address).

Domain redirection is most often done on a web-server with some type of script.
(often in combination with a database if redirecting many domain names)

You can do this with ASP script on IIS or PWS.

First create a DNS A-records for the domain name pointing to the IIS/PWS web-server that will do the redirection (not the destination web-server).

Then create a "default.asp" page on this web-server with the following contents:




Add "case" statements for each domain name you want to redirect.
You can automate this further with a database containing each domain name and corresponding redirect destination.

On IIS you can also point 404 errors (page not found) to this ASP page so requests for individual pages will also be redirected correctly.

Another variant of this is called "cloaking" - where your domain name still shows in the browser's address bar even after the redirection.
This is achieved by "hiding" the redirection in a frame-set where the first frame is zero width or height:

 






  • 21 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה

מאמרים קשורים

I get a database timeout expired error on my ASP.NET application. What can I do?

I get the following error when my ASP.NET application connects to the MS SQL server:...

How do I get my ASP.net application to display non-English language?

ASP.net allows the developer to encode the page using character sets other than unicode.  If...

I get a configuration error when I execute my application in a subdirectory. How do I resolve this?

This error may occur if the application is being run out of a subfolder and the subfolder is not...

Why can I still access my ASP.NET pages even though I disabled anonymous access to my directory?

After disabling anonymous access in the permission manager in the control panel, ASP.net pages...

After I configure the custom error setting in the control panel, I still get the generic error page?

Custom error setting is a web server setting that sets your website Error Pages, but you can...

Powered by WHMCompleteSolution