Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIS6 won't log alias domains as referer during redirection

Status
Not open for further replies.

denoxis

Programmer
Jul 22, 2002
154
US
Hi,

I was hosting a web site on a shared environment before (Windows
2000/IIS 5)Since the domain name was long, I also had similar domain
names pointed to the same IP. For example, my original domain was
abcd.com, and I also have abcd2.com and abcd3.com pointed
to the same IP. Then I was handling the rest in global.asa file.
If the incoming domain was other than abcd.com, then it was
redirecting to abcd.com (I want them to see the correct one in the
address field) Since this redirection was recorded by IIS, I was able
to keep track of number of people who typed the other domain names, by
looking at the referrer field in the logs.

Now I have a newer server (windows 2003/IIS 6). I have the same setup
in terms of domains. As for the log format, I have make sure referer
field is checked. Actually in the reports I can see the referers now,
but not the ones who redirects. For some reason none of these
redirections are recorded. If I type abcd2.com in the browser, it will
go to the website and in there it will be redirected to the correct
domain which is abcd.com (same IP, same web site, just the domain name is different).
However, the domain abcd2.com is not recorded as referer in the
logs. Is there any setting that I can change this behaviour?

I use response.redirect in the global.asa file. I don't use any host header since they are all pointing to a dedicated IP.

Thank you very much,

~D
 
I might remeber it wrong. In the first case, there was no redirection for a while. After I put the redirection in the global.asa, I was probably seeing old log entries that was recorded before I put the redirection.

I realized that if there is a redirection in session_onStart in global.asa, redirection is done before anything else. After it redirects, for some reason, the referer will be the redirected domain itself - IIS won't record the other domain as referer. If there wasn't any redirection i.e. if I let visitors to enter the website with wrong domain name, it is recorded as referer.

It's the same for redirection webs i.e. the web sites I set up under IIS6 with "redirection" option instead of a "Directory on this computer". When I enter the domain1 in a browser, which was set up to redirect to domain2 in IIS6, it will redirect rightaway and IIS6 will record domain2 as referer instead of domain1.

The question is, why all (or under what conditions) the redirections ruin HTTP_REFERER?
 
I am not sure if this help completely.but have you assigned for abc.com and abc2.com , http header with IIS, for example , right click the website properties and choose http header, then type for the value abc.com and in reverse as well.
aslo, click your website in the iis, right click properties then choose Web sites, >>advance , choose port 80 then IP address then value abc.com (for example) click ok

i hope will help
 
I tried and it didn't change anything. Thanks though...

Since global.asa redirects before everything I think that causes the problem. So I removed the redirection from global.asa, then I put absolute URLs everywhere. So when they enter , they will enter to the website without any redirection. As soon as they click on any links, they will continue from This way, is recorded as referer in the log files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top