Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

PRoblem: Website Dev Serv to Prod: How do map localhost/ap..

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  Forcing IISState to soft crash?  
Author Message
rwilliams

External


Since: Oct 14, 2003
Posts: 1



(Msg. 1) Posted: Tue Oct 14, 2003 10:41 am
Post subject: PRoblem: Website Dev Serv to Prod: How do map localhost/appname/ to domain.com/
Archived from groups: microsoft>public>inetserver>iis (more info?)

Newbie question: I'm developing web app on Win XP Pro using VS.NET/IIs5.1.
Vittual path is http://localhost/appname and thus all references to
development files must include the app path. However, I dont want to have to
specify http://www.domain.com/appname ; I would just like to use the url
without reference to appname. The only way I know to accomplish this is
issue a Find on "appname/" in all files in site and replace with a empty
string.

Can someone point me to a better way of doing this?

Thanks
Rodney Williams

 >> Stay informed about: PRoblem: Website Dev Serv to Prod: How do map localhost/ap.. 
Back to top
Login to vote
user960

External


Since: Oct 14, 2003
Posts: 1



(Msg. 2) Posted: Tue Oct 14, 2003 11:16 am
Post subject: Reply [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Use relative pathing

i.e: /Sub/page.asp will get you to a page in the sub
folder under your root.

If you need a fixed path use Server.MapPath();

 >> Stay informed about: PRoblem: Website Dev Serv to Prod: How do map localhost/ap.. 
Back to top
Login to vote
jdh341

External


Since: Sep 24, 2003
Posts: 29



(Msg. 3) Posted: Tue Oct 14, 2003 1:36 pm
Post subject: Re: PRoblem: Website Dev Serv to Prod: How do map localhost/appname/ to domain.c [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You can create this mapping in C:\WINNT\SYSTEM32\DRIVERS\ETC\HOSTS with the
assumption that winnt is your windows install directory.

"Rodney Williams" <rwilliams RemoveThis @118WebStreet.com> wrote in message
news:uU7%23bgkkDHA.3732@tk2msftngp13.phx.gbl...
 > Newbie question: I'm developing web app on Win XP Pro using VS.NET/IIs5.1.
 > Vittual path is <a style='text-decoration: underline;' href="http://localhost/appname" target="_blank">http://localhost/appname</a> and thus all references to
 > development files must include the app path. However, I dont want to have
to
 > specify <a style='text-decoration: underline;' href="http://www.domain.com/appname" target="_blank">http://www.domain.com/appname</a> ; I would just like to use the url
 > without reference to appname. The only way I know to accomplish this is
 > issue a Find on "appname/" in all files in site and replace with a empty
 > string.
 >
 > Can someone point me to a better way of doing this?
 >
 > Thanks
 > Rodney Williams
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: PRoblem: Website Dev Serv to Prod: How do map localhost/ap.. 
Back to top
Login to vote
row118

External


Since: Oct 15, 2003
Posts: 2



(Msg. 4) Posted: Wed Oct 15, 2003 11:44 am
Post subject: Re: PRoblem: Website Dev Serv to Prod: How do map localhost/appname/ to domain.c [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

thanks. Results from my following your advice are below. I think I may
have been asking the wrong question.

RESTATEMENT OF PROBLEM
----------------------
I webmaster 3 websites on a W2k3 Server/ASP.NET.
My developmnet environment is Win2k Pro/IIS5.1/VS.NET.

The problem is WinXPPro/IIS5.1 only allows 1 default website, thus all
websites have to be referenced with http://localhost during development.
It becomes messy (IMHO) to publish a site where the user has to type
extra path information(i.e. www.domain.com/appname/default.aspx as
opposed to www.domain.com/default.aspx (without the default.aspx of
course).

In Dreamweaver, hierchical path names were handled with no fuss: just
publish localhost/appname/dir1/subdir1/html_root to
http://domain.com/html_root

QUESTIONS
---------
1) How do I accomplish this in VS.NET? What configuration do I need to
accomplish this?
2) Outside of Visual Studio, how might I configure my "hosts" file?

WHAT I HAVE ATTEMPTED
----------------------
1) I tried the following "hosts" configuration:
localhost 127.0.0.1
test.domain1.com 192.168.1.1
test.domain2.com 192.168.1.1
WITH THE FOLLOWING host-headers configuration
on my IIS5.1 default web site as:
headername: test.domain1.com
value: test.domain1.com
All unassigned IP port 80
-- and likewise for test.domain2.com
-- Result: I kept gettting the default.aspx file I had placed in my
c:\inetpub\wwwroot.

2) I then added a redirect code to the default.aspx in wwwroot.
Pseudocode:
<pre>
On page load
if server_name = test.domain1.com
response.redirect localhost\domain1-approot
else if server_name = test.domain2.com
respnse.redirect localhost\domain2-approot
</pre>
--Result: recursion

Sorry for the long explain, but I wanna be clear. Does anyone hava a
solution?

Rodney Williams



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 >> Stay informed about: PRoblem: Website Dev Serv to Prod: How do map localhost/ap.. 
Back to top
Login to vote
row118

External


Since: Oct 15, 2003
Posts: 2



(Msg. 5) Posted: Wed Oct 15, 2003 11:44 am
Post subject: Re: Reply [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Im tring to void MapPath's and other such conventions. See my response
tgo Dave. Dreamweaver maps the paths for you under the hood via Site
Definitions. Perhaps it is my ingnorance of VS.NEt that I haven't been
able to achieve similar functionality for instance. I did find a
tutorial on Deployment Projects in VS.NET but it was specific to Windows
applications and not ASP.NET web apps.

Thanks for your quick response,
Rodney Williams

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 >> Stay informed about: PRoblem: Website Dev Serv to Prod: How do map localhost/ap.. 
Back to top
Login to vote
user641

External


Since: Aug 22, 2003
Posts: 1637



(Msg. 6) Posted: Wed Oct 15, 2003 2:54 pm
Post subject: Re: PRoblem: Website Dev Serv to Prod: How do map localhost/appname/ to domain.c [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"IIS" <row118 RemoveThis @earthlink.net> wrote in message
news:%23buS%23MzkDHA.2528@TK2MSFTNGP12.phx.gbl...
 >
 > thanks. Results from my following your advice are below. I think I may
 > have been asking the wrong question.
 >
 > RESTATEMENT OF PROBLEM
 > ----------------------
 > I webmaster 3 websites on a W2k3 Server/ASP.NET.
 > My developmnet environment is Win2k Pro/IIS5.1/VS.NET.
 >
 > The problem is WinXPPro/IIS5.1 only allows 1 default website, thus all
 > websites have to be referenced with <a style='text-decoration: underline;' href="http://localhost" target="_blank">http://localhost</a> during development.
 > It becomes messy (IMHO) to publish a site where the user has to type
 > extra path information(i.e. <a style='text-decoration: underline;' href="http://www.domain.com/appname/default.aspx" target="_blank">www.domain.com/appname/default.aspx</a> as
 > opposed to <a style='text-decoration: underline;' href="http://www.domain.com/default.aspx" target="_blank">www.domain.com/default.aspx</a> (without the default.aspx of
 > course).
 >
 > In Dreamweaver, hierchical path names were handled with no fuss: just
 > publish localhost/appname/dir1/subdir1/html_root to
<font color=purple> > <a style='text-decoration: underline;' href="http://domain.com/html_root</font" target="_blank">http://domain.com/html_root</font</a>>
 >
 > QUESTIONS
 > ---------
 > 1) How do I accomplish this in VS.NET? What configuration do I need to
 > accomplish this?
 > 2) Outside of Visual Studio, how might I configure my "hosts" file?
 >
 > WHAT I HAVE ATTEMPTED
 > ----------------------
 > 1) I tried the following "hosts" configuration:
 > localhost 127.0.0.1
 > test.domain1.com 192.168.1.1
 > test.domain2.com 192.168.1.1
 > WITH THE FOLLOWING host-headers configuration
 > on my IIS5.1 default web site as:
 > headername: test.domain1.com
 > value: test.domain1.com
 > All unassigned IP port 80
 > -- and likewise for test.domain2.com
 > -- Result: I kept gettting the default.aspx file I had placed in my
 > c:\inetpub\wwwroot.
 >
 > 2) I then added a redirect code to the default.aspx in wwwroot.
 > Pseudocode:
 > <pre>
 > On page load
 > if server_name = test.domain1.com
 > response.redirect localhost\domain1-approot
 > else if server_name = test.domain2.com
 > respnse.redirect localhost\domain2-approot
 > </pre>
 > --Result: recursion
 >
 > Sorry for the long explain, but I wanna be clear. Does anyone hava a
 > solution?

Your best bet may be to configure different root paths for each site and
only have one of them active in IIS at a time. In other words, change the
root path in IIS each time you need to work on a different web.

--
Tom Kaminski IIS MVP
<a style='text-decoration: underline;' href="http://www.iistoolshed.com/" target="_blank">http://www.iistoolshed.com/</a> - tools, scripts, and utilities for running IIS
<a style='text-decoration: underline;' href="http://mvp.support.microsoft.com/" target="_blank">http://mvp.support.microsoft.com/</a>
<a style='text-decoration: underline;' href="http://www.microsoft.com/windowsserver2003/community/centers/iis/" target="_blank">http://www.microsoft.com/windowsserver2003/community/centers/iis/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: PRoblem: Website Dev Serv to Prod: How do map localhost/ap.. 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]