| Author |
Include file question
|
|
|
| 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
| |
| Aaron [SQL Server MVP] 2004-10-21, 3:55 pm |
| 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" <ngnews@uslex.net> wrote in message
news:#2C1U72tEHA.2680@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
>
>
| |
| Steven Burn 2004-10-21, 3:55 pm |
| 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" <ngnews@uslex.net> wrote in message
news:#2C1U72tEHA.2680@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
>
>
| |
|
| The file structure is the same.
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:%23rgYFF3tEHA.1276@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" <ngnews@uslex.net> wrote in message
> news:#2C1U72tEHA.2680@TK2MSFTNGP15.phx.gbl...
IIS[color=darkred]
> file
>
>
| |
| Aaron [SQL Server MVP] 2004-10-21, 3:55 pm |
| 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.
| |
| Steven Burn 2004-10-21, 3:55 pm |
| 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" <ngnews@uslex.net> wrote in message
news:etVRWJ3tEHA.3680@TK2MSFTNGP10.phx.gbl...
> The file structure is the same.
>
>
> "Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
> news:%23rgYFF3tEHA.1276@TK2MSFTNGP12.phx.gbl...
> match
I[color=darkred]
all[color=darkred]
> IIS
I[color=darkred]
>
>
| |
|
| 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.
|
|
|
|