PDA

View Full Version : Alias to same point


jayhoonova
04-17-2004, 01:35 PM
Hi!
I have 2 domain names for ex. www.en.com and www.tr.com
and I have one server. My base domain is www.en.com

I' ll point them in same index.asp...
My Questions are;

1) if I have a link like in my index.asp
<a href="post.asp" target="_self">Click Here</a>
will it be seems like
www.en.com/link.asp
www.tr.com/link.asp
or because of my base domain all my links will seem like www.en.com/link.asp ??

2) How can I learn where user coming from? But I m not talking about referer I m talking about which domain he types to the adress bar....

how can I learn that he is coming from www.tr.com or www.en.com

by this I want to set session("lang") to different values...
is it possible to learn what user write his adress bar?

http_referer is only shows where user is coming from... if a website links you ... but I want to learn if user comes directly to my website by typing web adress by his self...
For example how can I get www.codingforum.com in this page with a command

Sorry about my english..

oracleguy
04-17-2004, 05:03 PM
The links, assuming their all relative will use whatever domain the user used to get to your site.

To figure out which domain they are coming through, you can get it by accessing the Request.ServerVariables("SERVER_NAME") variable.

jayhoonova
04-17-2004, 05:48 PM
Request.ServerVariables("SERVER_NAME") gives base domain name? or gives domain name which user has entered?

You know my 2 domain names works in same server and same files..

oracleguy
04-18-2004, 01:11 AM
You'd have to do an experment to see what happens, it probably depends on how you are redirecting your domains. If both are setup with DNS on the server, then the answer would be probably be yes.

jayhoonova
04-18-2004, 11:01 AM
Thanks for your help
I think it will works...

Roy Sinclair
04-19-2004, 06:25 PM
It will definitely work but you've got to be extremely careful that you never let a link get into those "shared" pages with an absolute URL pointing to one of those domains.

There's a lot of "html editor" software out there that'll "helpfully" add the whole url to a relative address.

Keltoi
04-19-2004, 07:55 PM
I use Request.ServerVariables("HTTP_HOST") which gives the domain set up in the HTTP header.

I use this for a number of sites (domains) which all run off the same webspace. I can then use this information to display specific information depending on the domain the user is visiting.

Indeed (I've just checked), HTTP_HOST gives the same result (for me at least) as SERVER_NAME; so what ever is in the URL is what is found using this method.