By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,356 Members | 2,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,356 IT Pros & Developers. It's quick & easy.

Include file question

P: n/a
qaz
I run a web site on both a testing server and a "production" server. I
noticed that references to the include file do not work on the testing
server but they do work on the production server. I have to change all
references like this:

<!--#INCLUDE VIRTUAL="include/conndb.asp"-->

to references like this:

<!--#INCLUDE FILE="c:/inetpub/wwwroot/ms/include/conndb.asp"-->

To get the system to work on the testing server.

I think that this must be an IIS question. I am guessing that I have IIS
configured differently on the testing and production servers. What do I
need to change to get the testing server to correctly read the VIRTUAL file
path?

Thanks
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Why don't you change the testing server's virtual folder structure to match
production. You should never use hard-coded references like c:\ in an
include directive, in my opinion.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"qaz" <ng****@uslex.net> wrote in message
news:#2**************@TK2MSFTNGP15.phx.gbl...
I run a web site on both a testing server and a "production" server. I
noticed that references to the include file do not work on the testing
server but they do work on the production server. I have to change all
references like this:

<!--#INCLUDE VIRTUAL="include/conndb.asp"-->

to references like this:

<!--#INCLUDE FILE="c:/inetpub/wwwroot/ms/include/conndb.asp"-->

To get the system to work on the testing server.

I think that this must be an IIS question. I am guessing that I have IIS
configured differently on the testing and production servers. What do I
need to change to get the testing server to correctly read the VIRTUAL file path?

Thanks

Jul 21 '05 #2

P: n/a
If it's just something small and simple, I'd just have it check the server
it's running on (i.e. whether it's local or not).

e.g.

<%
strServer = Request.ServerVariables("HTTP_HOST")
Select Case lcase(strServer)
Case "server_name"
%>
<!--#INCLUDE VIRTUAL="include/conndb.asp"-->
<%
Case Else
%>
<!--#INCLUDE FILE="c:/inetpub/wwwroot/ms/include/conndb.asp"-->
<%
End Select
%>

Not exactly very efficient, but it works (and saves time changing the paths
;o))

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"qaz" <ng****@uslex.net> wrote in message
news:#2**************@TK2MSFTNGP15.phx.gbl...
I run a web site on both a testing server and a "production" server. I
noticed that references to the include file do not work on the testing
server but they do work on the production server. I have to change all
references like this:

<!--#INCLUDE VIRTUAL="include/conndb.asp"-->

to references like this:

<!--#INCLUDE FILE="c:/inetpub/wwwroot/ms/include/conndb.asp"-->

To get the system to work on the testing server.

I think that this must be an IIS question. I am guessing that I have IIS
configured differently on the testing and production servers. What do I
need to change to get the testing server to correctly read the VIRTUAL file path?

Thanks

Jul 21 '05 #3

P: n/a
qaz
The file structure is the same.
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Why don't you change the testing server's virtual folder structure to match production. You should never use hard-coded references like c:\ in an
include directive, in my opinion.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"qaz" <ng****@uslex.net> wrote in message
news:#2**************@TK2MSFTNGP15.phx.gbl...
I run a web site on both a testing server and a "production" server. I
noticed that references to the include file do not work on the testing
server but they do work on the production server. I have to change all
references like this:

<!--#INCLUDE VIRTUAL="include/conndb.asp"-->

to references like this:

<!--#INCLUDE FILE="c:/inetpub/wwwroot/ms/include/conndb.asp"-->

To get the system to work on the testing server.

I think that this must be an IIS question. I am guessing that I have IIS configured differently on the testing and production servers. What do I
need to change to get the testing server to correctly read the VIRTUAL

file
path?

Thanks


Jul 21 '05 #4

P: n/a
I didn't say file structure, I said virtual folder structure...

--
http://www.aspfaq.com/
(Reverse address to reply.)

The file structure is the same.

Jul 21 '05 #5

P: n/a
I think he meant, why don't you change the prod serv to match the pub serv,
to allow you to use;

<!--#INCLUDE VIRTUAL="include/conndb.asp"-->

..... on both of them?

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"qaz" <ng****@uslex.net> wrote in message
news:et**************@TK2MSFTNGP10.phx.gbl...
The file structure is the same.
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Why don't you change the testing server's virtual folder structure to

match
production. You should never use hard-coded references like c:\ in an
include directive, in my opinion.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"qaz" <ng****@uslex.net> wrote in message
news:#2**************@TK2MSFTNGP15.phx.gbl...
I run a web site on both a testing server and a "production" server. I noticed that references to the include file do not work on the testing
server but they do work on the production server. I have to change all references like this:

<!--#INCLUDE VIRTUAL="include/conndb.asp"-->

to references like this:

<!--#INCLUDE FILE="c:/inetpub/wwwroot/ms/include/conndb.asp"-->

To get the system to work on the testing server.

I think that this must be an IIS question. I am guessing that I have IIS configured differently on the testing and production servers. What do I need to change to get the testing server to correctly read the VIRTUAL

file
path?

Thanks



Jul 21 '05 #6

P: n/a
I bet the problem is that the folder c:\inetpub\wwwroot\ms\include is
not the include folder in the root of the web on the production server
like it is on the testing server.

I think I simplified it enough for you to get it after being told twice
before.

qaz wrote:
I run a web site on both a testing server and a "production" server. I
noticed that references to the include file do not work on the testing
server but they do work on the production server. I have to change all
references like this:

<!--#INCLUDE VIRTUAL="include/conndb.asp"-->

to references like this:

<!--#INCLUDE FILE="c:/inetpub/wwwroot/ms/include/conndb.asp"-->

To get the system to work on the testing server.

I think that this must be an IIS question. I am guessing that I have IIS
configured differently on the testing and production servers. What do I
need to change to get the testing server to correctly read the VIRTUAL file
path?

Thanks


--
Please do not contact me directly or ask me to contact you directly for
assistance.

If your question is worth asking, it's worth posting.

If itís not worth posting you should have done a search on
http://www.google.com/ http://www.google.com/grphp?hl=en&tab=wg&q= or
http://news.google.com/froogle?hl=en&tab=nf&ned=us&q= before wasting our
time.
Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.