preferred URL

S

shank

On our website www.mydomain.com we have extra domain names parked.
Assume you enter the site with www.extradomain.com

I redirect with the following code:
<%
sname = UCASE(Request.ServerVariables("SERVER_NAME"))
If InStr(sname,"EXTRADOMAIN") <> 0 then
response.redirect "mypage.asp"
End If
%>

It redirects to the proper page, but the URL in the browser address bar
reverts to:
http://www.mydomain.com/fld/fld2.asp

Technically, this is correct.
However, is there a way for me to force the address bar to stay:
www.extradomain.com ?
(personal preference)

thanks!
 
R

Ray at

If you're really redirecting just to page.asp, as opposed to a fully
qualified URL, the domain name should not change. What does your redirect
really say?

Ray at work
 
J

Jeff Cochran

On our website www.mydomain.com we have extra domain names parked.
Assume you enter the site with www.extradomain.com

I redirect with the following code:
<%
sname = UCASE(Request.ServerVariables("SERVER_NAME"))
If InStr(sname,"EXTRADOMAIN") <> 0 then
response.redirect "mypage.asp"
End If
%>

It redirects to the proper page, but the URL in the browser address bar
reverts to:
http://www.mydomain.com/fld/fld2.asp

Technically, this is correct.
However, is there a way for me to force the address bar to stay:
www.extradomain.com ?
(personal preference)

As an alternative, how about using host headers for your site to
accept these domains, then simply loading the appropriate page based
on the header? You'll need to forego any links referencing the
domain, which may or may not be easy depending on how you designed the
site.

Jeff
 
R

Roland Hall

shank said:
Without posting my real domain, this is teh actual redirect code on
default.asp

<%
sname = UCASE(Request.ServerVariables("SERVER_NAME"))
If InStr(sname,"EXTRADOMAIN") <0 then
response.redirect "http://www.mydomain.com/fld/fld2/"
End If
%>
Is it possible to have the URL as: http://www.extradomain.com/fld/fld2/
thanks!

You can also create the default page on the fly and eliminate the redirect.

<%
dim sname
sname = UCASE(Request.ServerVariables("SERVER_NAME"))
If InStr(sname,"EXTRADOMAIN") <> 0 then
domain1
else
domain2
end if

sub Prt(strText)
Response.Write(strText) & vbCrLf
end sub

sub domain1()
Prt("<!DOCTYPE html PUBLIC ""-//W3C//DTD HTML 4.01//EN"">")
Prt("<html>")
Prt("<head>")
....
end sub

sub domain2()
....
end sub
%>

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top