469,336 Members | 5,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

preferred URL

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!
Jul 19 '05 #1
7 1763
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

"shank" <sh***@tampabay.rr.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
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!

Jul 19 '05 #2
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!

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
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

"shank" <sh***@tampabay.rr.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
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!


Jul 19 '05 #3
Yes, don't include the domain!

Ray at work

"shank" <sh***@tampabay.rr.com> wrote in message
news:OS*************@TK2MSFTNGP11.phx.gbl...
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!

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
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

"shank" <sh***@tampabay.rr.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
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!



Jul 19 '05 #4
Open to the public but shank doesn't want you there;-)

Mike
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
Yes, don't include the domain!

Ray at work

"shank" <sh***@tampabay.rr.com> wrote in message
news:OS*************@TK2MSFTNGP11.phx.gbl...
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!

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
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

"shank" <sh***@tampabay.rr.com> wrote in message
news:Ot**************@TK2MSFTNGP12.phx.gbl...
> 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!
>
>



Jul 19 '05 #5
On Wed, 10 Dec 2003 12:13:09 -0500, "shank" <sh***@tampabay.rr.com>
wrote:
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
Jul 19 '05 #6
"Mike D" <Mi***@nospam.com> wrote in message
news:ey**************@TK2MSFTNGP09.phx.gbl...
Open to the public but shank doesn't want you there;-)

Mike


So, only Ray is not allowed?
Jul 19 '05 #7
"shank" wrote:
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.
Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Dave Benjamin | last post: by
22 posts views Thread by Jane Withnolastname | last post: by
5 posts views Thread by Rod | last post: by
7 posts views Thread by stabbert | last post: by
2 posts views Thread by OzzyC | last post: by
4 posts views Thread by Bill Jackson | last post: by
3 posts views Thread by moondaddy | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.