how to hide the homepage"s filename from the URL?
how to hide the homepage"s filename from the URL?
am 05.12.2007 20:40:36 von Wolfing
Wait, it's not an obvious thing (at least I don't think so)
I have a development and a production server. The development
(internal) server is dev.blah.com and the production (external) is
www.blah.com.
They both have a default.asp file configured in IIS, so when I go to
www.blah.com or dev.blah.com, the default page shows and the url
showing is www.blah.com or dev.blah.com respectively. So far so good.
In all the site's pages, I have links back to the home page set as '/
default.asp', that way, when I work in the dev server, the link goes
to the dev server's default.asp, and when I'm in the live server, the
link goes to the live server's default.asp
Well, the real question is, how do I do so when I click on these
links, the browser's URL doesn't show as http://dev.blah.com/default.asp
or http://www.blah.com/default.asp? (i.e. I don't want the "/
default.asp" to show, and do this without explicitly using
'www.blah.com' for the link, as then I'd lose the flexibility I had
before)
Thanks
Re: how to hide the homepage"s filename from the URL?
am 05.12.2007 21:38:49 von Kristofer Gafvert
Hello,
You say you link to '/default.asp', so it is not strange at all that the
browser shows what you actually tell the browser to do.
If you instead linked to '/' IIS will serve whatever document is the default
document in the root folder.
PS: I would recommend you to use relative links. If you ever need to move
this web application into a folder (it becames a part of a bigger website),
you must change all your links. If you use relative links, you do not need
to do this.
--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info
"Wolfing" skrev i meddelandet
news:2487cd14-296b-4364-9014-0a5b2bd59f7d@y5g2000hsf.googleg roups.com...
> Wait, it's not an obvious thing (at least I don't think so)
> I have a development and a production server. The development
> (internal) server is dev.blah.com and the production (external) is
> www.blah.com.
> They both have a default.asp file configured in IIS, so when I go to
> www.blah.com or dev.blah.com, the default page shows and the url
> showing is www.blah.com or dev.blah.com respectively. So far so good.
> In all the site's pages, I have links back to the home page set as '/
> default.asp', that way, when I work in the dev server, the link goes
> to the dev server's default.asp, and when I'm in the live server, the
> link goes to the live server's default.asp
> Well, the real question is, how do I do so when I click on these
> links, the browser's URL doesn't show as http://dev.blah.com/default.asp
> or http://www.blah.com/default.asp? (i.e. I don't want the "/
> default.asp" to show, and do this without explicitly using
> 'www.blah.com' for the link, as then I'd lose the flexibility I had
> before)
> Thanks
Re: how to hide the homepage"s filename from the URL?
am 05.12.2007 21:39:42 von David Wang
On Dec 5, 11:40 am, Wolfing wrote:
> Wait, it's not an obvious thing (at least I don't think so)
> I have a development and a production server. The development
> (internal) server is dev.blah.com and the production (external) iswww.blah.com.
> They both have a default.asp file configured in IIS, so when I go towww.blah.comor dev.blah.com, the default page shows and the url
> showing iswww.blah.comor dev.blah.com respectively. So far so good.
> In all the site's pages, I have links back to the home page set as '/
> default.asp', that way, when I work in the dev server, the link goes
> to the dev server's default.asp, and when I'm in the live server, the
> link goes to the live server's default.asp
> Well, the real question is, how do I do so when I click on these
> links, the browser's URL doesn't show ashttp://dev.blah.com/default.asp
> orhttp://www.blah.com/default.asp?(i.e. I don't want the "/
> default.asp" to show, and do this without explicitly using
> 'www.blah.com'for the link, as then I'd lose the flexibility I had
> before)
> Thanks
If it works with "/default.asp" right now, then you can just use "/"
instead of "/default.asp" to get what you want.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
Re: how to hide the homepage"s filename from the URL?
am 06.12.2007 15:00:45 von Wolfing
On Dec 5, 3:39 pm, David Wang wrote:
> On Dec 5, 11:40 am, Wolfing wrote:
>
>
>
> > Wait, it's not an obvious thing (at least I don't think so)
> > I have a development and a production server. The development
> > (internal) server is dev.blah.com and the production (external) iswww.blah.com.
> > They both have a default.asp file configured in IIS, so when I go towww.blah.comordev.blah.com, the default page shows and the url
> > showing iswww.blah.comordev.blah.com respectively. So far so good.
> > In all the site's pages, I have links back to the home page set as '/
> > default.asp', that way, when I work in the dev server, the link goes
> > to the dev server's default.asp, and when I'm in the live server, the
> > link goes to the live server's default.asp
> > Well, the real question is, how do I do so when I click on these
> > links, the browser's URL doesn't show ashttp://dev.blah.com/default.asp
> > orhttp://www.blah.com/default.asp?(i.e. I don't want the "/
> > default.asp" to show, and do this without explicitly using
> > 'www.blah.com'forthe link, as then I'd lose the flexibility I had
> > before)
> > Thanks
>
> If it works with "/default.asp" right now, then you can just use "/"
> instead of "/default.asp" to get what you want.
>
> //Davidhttp://w3-4u.blogspot.comhttp://blogs.msdn.com/David. Wang
> //
I tried that too, but it then shows as www.blah.com/ instead of www.blah.com
.. Guess that's ok but was wondering if there was something I could do
in IIS or in the code so it shows just the www.blah.com
Re: how to hide the homepage"s filename from the URL?
am 07.12.2007 00:00:59 von David Wang
On Dec 6, 6:00 am, Wolfing wrote:
> On Dec 5, 3:39 pm, David Wang wrote:
>
>
>
>
>
> > On Dec 5, 11:40 am, Wolfing wrote:
>
> > > Wait, it's not an obvious thing (at least I don't think so)
> > > I have a development and a production server. The development
> > > (internal) server is dev.blah.com and the production (external) iswww.blah.com.
> > > They both have a default.asp file configured in IIS, so when I go towww.blah.comordev.blah.com, the default page shows and the url
> > > showing iswww.blah.comordev.blah.comrespectively. So far so good.
> > > In all the site's pages, I have links back to the home page set as '/
> > > default.asp', that way, when I work in the dev server, the link goes
> > > to the dev server's default.asp, and when I'm in the live server, the
> > > link goes to the live server's default.asp
> > > Well, the real question is, how do I do so when I click on these
> > > links, the browser's URL doesn't show ashttp://dev.blah.com/default.asp
> > > orhttp://www.blah.com/default.asp?(i.e. I don't want the "/
> > > default.asp" to show, and do this without explicitly using
> > > 'www.blah.com'forthelink, as then I'd lose the flexibility I had
> > > before)
> > > Thanks
>
> > If it works with "/default.asp" right now, then you can just use "/"
> > instead of "/default.asp" to get what you want.
>
> > //Davidhttp://w3-4u.blogspot.comhttp://blogs.msdn.com/David. Wang
> > //
>
> I tried that too, but it then shows aswww.blah.com/instead ofwww.blah.com
> . Guess that's ok but was wondering if there was something I could do
> in IIS or in the code so it shows just thewww.blah.com- Hide quoted text -
>
> - Show quoted text -
Why don't you use ASP code to dynamically generate http://www.blah.com
as the href for those links, instead of using "/default.asp" ? Plenty
of ServerVariables in ASP to allow you to do this automatically and
for all environments.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
Re: how to hide the homepage"s filename from the URL?
am 07.12.2007 22:37:51 von Wolfing
On Dec 6, 6:00 pm, David Wang wrote:
> On Dec 6, 6:00 am, Wolfing wrote:
>
>
>
> > On Dec 5, 3:39 pm, David Wang wrote:
>
> > > On Dec 5, 11:40 am, Wolfing wrote:
>
> > > > Wait, it's not an obvious thing (at least I don't think so)
> > > > I have a development and a production server. The development
> > > > (internal) server is dev.blah.com and the production (external) iswww.blah.com.
> > > > They both have a default.asp file configured in IIS, so when I go towww.blah.comordev.blah.com, the default page shows and the url
> > > > showing iswww.blah.comordev.blah.comrespectively. So far so good.
> > > > In all the site's pages, I have links back to the home page set as '/
> > > > default.asp', that way, when I work in the dev server, the link goes
> > > > to the dev server's default.asp, and when I'm in the live server, the
> > > > link goes to the live server's default.asp
> > > > Well, the real question is, how do I do so when I click on these
> > > > links, the browser's URL doesn't show ashttp://dev.blah.com/default.asp
> > > > orhttp://www.blah.com/default.asp?(i.e. I don't want the "/
> > > > default.asp" to show, and do this without explicitly using
> > > > 'www.blah.com'forthelink, as then I'd lose the flexibility I had
> > > > before)
> > > > Thanks
>
> > > If it works with "/default.asp" right now, then you can just use "/"
> > > instead of "/default.asp" to get what you want.
>
> > > //Davidhttp://w3-4u.blogspot.comhttp://blogs.msdn.com/David. Wang
> > > //
>
> > I tried that too, but it then shows aswww.blah.com/insteadofwww.blah.com
> > . Guess that's ok but was wondering if there was something I could do
> > in IIS or in the code so it shows just thewww.blah.com-Hide quoted text -
>
> > - Show quoted text -
>
> Why don't you use ASP code to dynamically generatehttp://www.blah.com
> as the href for those links, instead of using "/default.asp" ? Plenty
> of ServerVariables in ASP to allow you to do this automatically and
> for all environments.
>
> //Davidhttp://w3-4u.blogspot.comhttp://blogs.msdn.com/David. Wang
> //
Maybe I will. For now I changed the links from /home.asp to / ... if
they complain they don't like the '/', I'll change the ASP. Thanks :)