Home All Groups Group Topic Archive Search About
Author
7 Jan 2009 8:08 PM
Karl E. Peterson

Hi Folks --

Old problem I'm considering revisiting.  Say I have a bunch of "topics" and would
like each to share a common code base but be accessed through their own folders.
IOW, something like this:

   http://domain.org/subfolder/topicX/
   http://domain.org/subfolder/topicY/
   http://domain.org/subfolder/topicZ/

The content can all be generated from a database and some ASP code.  So, what I'd
really like to do is have an extremely simple index.asp in each folder that
determined it's own folder name ("topicX"), and used this as a key to pass to a
common code base to generates the rest of the content.  Problem is, as my hazy
memory recalls, calling code in a parent directory  (..\code) is considered a
potential security hazard, and IIS is set to prevent it.  Is there a better design,
that doesn't involve replicating the code in each and every subfolder?  (Am I making
any sense at all? <g>)

Thanks...   Karl
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
8 Jan 2009 3:03 AM
Mike Mueller
Karl

You can use Request.ServerVariables("PATH_INFO ") to find out exactly where
you are at from the root.
--strThisPage= Request.ServerVariables("PATH_INFO ")

you could then parse the returned string and use an SQL call to get the info
from your db
--"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage &
"')"

and then you can use that info to fill in your page.I would probably make
this a function and use it in an include, to make the page lighterweight. I
use a similiar strategy in several sites that I work with- ending up with a
code working off of this logic:

-virtual include getpage

-virtual include header
<title><%=strTitle%></title>
-virtual include body
<%=strBody%>
-virtual include footer
and getpage has the routine to read your location, get the title and the
body







Show quoteHide quote
"Karl E. Peterson" <k***@mvps.org> wrote in message
news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
> Hi Folks --
>
> Old problem I'm considering revisiting.  Say I have a bunch of "topics"
> and would like each to share a common code base but be accessed through
> their own folders. IOW, something like this:
>
>   http://domain.org/subfolder/topicX/
>   http://domain.org/subfolder/topicY/
>   http://domain.org/subfolder/topicZ/
>
> The content can all be generated from a database and some ASP code.  So,
> what I'd really like to do is have an extremely simple index.asp in each
> folder that determined it's own folder name ("topicX"), and used this as a
> key to pass to a common code base to generates the rest of the content.
> Problem is, as my hazy memory recalls, calling code in a parent directory
> (..\code) is considered a potential security hazard, and IIS is set to
> prevent it.  Is there a better design, that doesn't involve replicating
> the code in each and every subfolder?  (Am I making any sense at all? <g>)
>
> Thanks...   Karl
> --
> .NET: It's About Trust!
> http://vfred.mvps.org
>
Are all your drivers up to date? click for free checkup

Author
8 Jan 2009 7:43 PM
Karl E. Peterson
Hi Mike --

Yeah, that's the general idea.  The problem seems to be if I need to use a ..\code
include page in there.  (Working from memory here, as it's been a long time since I
looked at this.)  IIS in 2003/2008 is set to automatically not allow that for fear
of some sort of exploit.  Using your names, how do you avoid having to put
getpage/header/body/footer pages in each subfolder?

Thanks...   Karl


Mike Mueller wrote:
Show quoteHide quote
> You can use Request.ServerVariables("PATH_INFO ") to find out exactly where
> you are at from the root.
> --strThisPage= Request.ServerVariables("PATH_INFO ")
>
> you could then parse the returned string and use an SQL call to get the info
> from your db
> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage &
> "')"
>
> and then you can use that info to fill in your page.I would probably make
> this a function and use it in an include, to make the page lighterweight. I
> use a similiar strategy in several sites that I work with- ending up with a
> code working off of this logic:
>
> -virtual include getpage
>
> -virtual include header
> <title><%=strTitle%></title>
> -virtual include body
> <%=strBody%>
> -virtual include footer
> and getpage has the routine to read your location, get the title and the
> body
>
>
>
>
>
>
>
> "Karl E. Peterson" <k***@mvps.org> wrote in message
> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
>> Hi Folks --
>>
>> Old problem I'm considering revisiting.  Say I have a bunch of "topics"
>> and would like each to share a common code base but be accessed through
>> their own folders. IOW, something like this:
>>
>>   http://domain.org/subfolder/topicX/
>>   http://domain.org/subfolder/topicY/
>>   http://domain.org/subfolder/topicZ/
>>
>> The content can all be generated from a database and some ASP code.  So,
>> what I'd really like to do is have an extremely simple index.asp in each
>> folder that determined it's own folder name ("topicX"), and used this as a
>> key to pass to a common code base to generates the rest of the content.
>> Problem is, as my hazy memory recalls, calling code in a parent directory
>> (..\code) is considered a potential security hazard, and IIS is set to
>> prevent it.  Is there a better design, that doesn't involve replicating
>> the code in each and every subfolder?  (Am I making any sense at all? <g>)
>>
>> Thanks...   Karl
>> --
>> .NET: It's About Trust!
>> http://vfred.mvps.org

--
..NET: It's About Trust!
http://vfred.mvps.org
Author
9 Jan 2009 1:14 AM
Mike Mueller
<!--#include virtual="/includes/filename.ext"-->

and then I put all of the common code pages into the includes directory.
Include Virtual is relative to the site root.



Show quoteHide quote
"Karl E. Peterson" <k***@mvps.org> wrote in message
news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl...
> Hi Mike --
>
> Yeah, that's the general idea.  The problem seems to be if I need to use a
> ..\code include page in there.  (Working from memory here, as it's been a
> long time since I looked at this.)  IIS in 2003/2008 is set to
> automatically not allow that for fear of some sort of exploit.  Using your
> names, how do you avoid having to put getpage/header/body/footer pages in
> each subfolder?
>
> Thanks...   Karl
>
>
> Mike Mueller wrote:
>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly
>> where
>> you are at from the root.
>> --strThisPage= Request.ServerVariables("PATH_INFO ")
>>
>> you could then parse the returned string and use an SQL call to get the
>> info
>> from your db
>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage
>> &
>> "')"
>>
>> and then you can use that info to fill in your page.I would probably make
>> this a function and use it in an include, to make the page lighterweight.
>> I
>> use a similiar strategy in several sites that I work with- ending up with
>> a
>> code working off of this logic:
>>
>> -virtual include getpage
>>
>> -virtual include header
>> <title><%=strTitle%></title>
>> -virtual include body
>> <%=strBody%>
>> -virtual include footer
>> and getpage has the routine to read your location, get the title and the
>> body
>>
>>
>>
>>
>>
>>
>>
>> "Karl E. Peterson" <k***@mvps.org> wrote in message
>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
>>> Hi Folks --
>>>
>>> Old problem I'm considering revisiting.  Say I have a bunch of "topics"
>>> and would like each to share a common code base but be accessed through
>>> their own folders. IOW, something like this:
>>>
>>>   http://domain.org/subfolder/topicX/
>>>   http://domain.org/subfolder/topicY/
>>>   http://domain.org/subfolder/topicZ/
>>>
>>> The content can all be generated from a database and some ASP code.  So,
>>> what I'd really like to do is have an extremely simple index.asp in each
>>> folder that determined it's own folder name ("topicX"), and used this as
>>> a
>>> key to pass to a common code base to generates the rest of the content.
>>> Problem is, as my hazy memory recalls, calling code in a parent
>>> directory
>>> (..\code) is considered a potential security hazard, and IIS is set to
>>> prevent it.  Is there a better design, that doesn't involve replicating
>>> the code in each and every subfolder?  (Am I making any sense at all?
>>> <g>)
>>>
>>> Thanks...   Karl
>>> --
>>> .NET: It's About Trust!
>>> http://vfred.mvps.org
>
> --
> .NET: It's About Trust!
> http://vfred.mvps.org
>
Author
9 Jan 2009 1:25 AM
Karl E. Peterson
Mike Mueller wrote:
> <!--#include virtual="/includes/filename.ext"-->
>
> and then I put all of the common code pages into the includes directory.
> Include Virtual is relative to the site root.

Would it be relative to the root of a subweb on a test server?  (I build on a
subweb, and publish to a "full-blown" web.)  I thought not.  That something like
that would still be looking at the server root.

Thanks...   Karl
--
..NET: It's About Trust!
http://vfred.mvps.org



Show quoteHide quote
> "Karl E. Peterson" <k***@mvps.org> wrote in message
> news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl...
>> Hi Mike --
>>
>> Yeah, that's the general idea.  The problem seems to be if I need to use a
>> ..\code include page in there.  (Working from memory here, as it's been a
>> long time since I looked at this.)  IIS in 2003/2008 is set to
>> automatically not allow that for fear of some sort of exploit.  Using your
>> names, how do you avoid having to put getpage/header/body/footer pages in
>> each subfolder?
>>
>> Thanks...   Karl
>>
>>
>> Mike Mueller wrote:
>>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly
>>> where
>>> you are at from the root.
>>> --strThisPage= Request.ServerVariables("PATH_INFO ")
>>>
>>> you could then parse the returned string and use an SQL call to get the
>>> info
>>> from your db
>>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage
>>> &
>>> "')"
>>>
>>> and then you can use that info to fill in your page.I would probably make
>>> this a function and use it in an include, to make the page lighterweight.
>>> I
>>> use a similiar strategy in several sites that I work with- ending up with
>>> a
>>> code working off of this logic:
>>>
>>> -virtual include getpage
>>>
>>> -virtual include header
>>> <title><%=strTitle%></title>
>>> -virtual include body
>>> <%=strBody%>
>>> -virtual include footer
>>> and getpage has the routine to read your location, get the title and the
>>> body
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> "Karl E. Peterson" <k***@mvps.org> wrote in message
>>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
>>>> Hi Folks --
>>>>
>>>> Old problem I'm considering revisiting.  Say I have a bunch of "topics"
>>>> and would like each to share a common code base but be accessed through
>>>> their own folders. IOW, something like this:
>>>>
>>>>   http://domain.org/subfolder/topicX/
>>>>   http://domain.org/subfolder/topicY/
>>>>   http://domain.org/subfolder/topicZ/
>>>>
>>>> The content can all be generated from a database and some ASP code.  So,
>>>> what I'd really like to do is have an extremely simple index.asp in each
>>>> folder that determined it's own folder name ("topicX"), and used this as
>>>> a
>>>> key to pass to a common code base to generates the rest of the content.
>>>> Problem is, as my hazy memory recalls, calling code in a parent
>>>> directory
>>>> (..\code) is considered a potential security hazard, and IIS is set to
>>>> prevent it.  Is there a better design, that doesn't involve replicating
>>>> the code in each and every subfolder?  (Am I making any sense at all?
>>>> <g>)
>>>>
>>>> Thanks...   Karl
>>>> --
>>>> .NET: It's About Trust!
>>>> http://vfred.mvps.org
>>
>> --
>> .NET: It's About Trust!
>> http://vfred.mvps.org
Author
9 Jan 2009 9:07 AM
Stefan B Rusynko
No
- it always relative to the main root

--

_____________________________________________
SBR @ ENJOY (-:              [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!"  (-;
_____________________________________________


Show quoteHide quote
"Karl E. Peterson" <k***@mvps.org> wrote in message news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl...
| Mike Mueller wrote:
| > <!--#include virtual="/includes/filename.ext"-->
| >
| > and then I put all of the common code pages into the includes directory.
| > Include Virtual is relative to the site root.
|
| Would it be relative to the root of a subweb on a test server?  (I build on a
| subweb, and publish to a "full-blown" web.)  I thought not.  That something like
| that would still be looking at the server root.
|
| Thanks...   Karl
| --
| .NET: It's About Trust!
| http://vfred.mvps.org
|
|
|
| > "Karl E. Peterson" <k***@mvps.org> wrote in message
| > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl...
| >> Hi Mike --
| >>
| >> Yeah, that's the general idea.  The problem seems to be if I need to use a
| >> ..\code include page in there.  (Working from memory here, as it's been a
| >> long time since I looked at this.)  IIS in 2003/2008 is set to
| >> automatically not allow that for fear of some sort of exploit.  Using your
| >> names, how do you avoid having to put getpage/header/body/footer pages in
| >> each subfolder?
| >>
| >> Thanks...   Karl
| >>
| >>
| >> Mike Mueller wrote:
| >>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly
| >>> where
| >>> you are at from the root.
| >>> --strThisPage= Request.ServerVariables("PATH_INFO ")
| >>>
| >>> you could then parse the returned string and use an SQL call to get the
| >>> info
| >>> from your db
| >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage
| >>> &
| >>> "')"
| >>>
| >>> and then you can use that info to fill in your page.I would probably make
| >>> this a function and use it in an include, to make the page lighterweight.
| >>> I
| >>> use a similiar strategy in several sites that I work with- ending up with
| >>> a
| >>> code working off of this logic:
| >>>
| >>> -virtual include getpage
| >>>
| >>> -virtual include header
| >>> <title><%=strTitle%></title>
| >>> -virtual include body
| >>> <%=strBody%>
| >>> -virtual include footer
| >>> and getpage has the routine to read your location, get the title and the
| >>> body
| >>>
| >>>
| >>>
| >>>
| >>>
| >>>
| >>>
| >>> "Karl E. Peterson" <k***@mvps.org> wrote in message
| >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
| >>>> Hi Folks --
| >>>>
| >>>> Old problem I'm considering revisiting.  Say I have a bunch of "topics"
| >>>> and would like each to share a common code base but be accessed through
| >>>> their own folders. IOW, something like this:
| >>>>
| >>>>   http://domain.org/subfolder/topicX/
| >>>>   http://domain.org/subfolder/topicY/
| >>>>   http://domain.org/subfolder/topicZ/
| >>>>
| >>>> The content can all be generated from a database and some ASP code.  So,
| >>>> what I'd really like to do is have an extremely simple index.asp in each
| >>>> folder that determined it's own folder name ("topicX"), and used this as
| >>>> a
| >>>> key to pass to a common code base to generates the rest of the content.
| >>>> Problem is, as my hazy memory recalls, calling code in a parent
| >>>> directory
| >>>> (..\code) is considered a potential security hazard, and IIS is set to
| >>>> prevent it.  Is there a better design, that doesn't involve replicating
| >>>> the code in each and every subfolder?  (Am I making any sense at all?
| >>>> <g>)
| >>>>
| >>>> Thanks...   Karl
| >>>> --
| >>>> .NET: It's About Trust!
| >>>> http://vfred.mvps.org
| >>
| >> --
| >> .NET: It's About Trust!
| >> http://vfred.mvps.org
|
|
|
Author
9 Jan 2009 7:30 PM
Karl E. Peterson
Stefan B Rusynko wrote:
> No
> - it always relative to the main root

Yeah, that's the issue.  Can't use the same code on the test subweb and deployed
web.  :-/
--
..NET: It's About Trust!
http://vfred.mvps.org




Show quoteHide quote
> "Karl E. Peterson" <k***@mvps.org> wrote in message
> news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl...
>| Mike Mueller wrote:
>| > <!--#include virtual="/includes/filename.ext"-->
>| >
>| > and then I put all of the common code pages into the includes directory.
>| > Include Virtual is relative to the site root.
>|
>| Would it be relative to the root of a subweb on a test server?  (I build on a
>| subweb, and publish to a "full-blown" web.)  I thought not.  That something like
>| that would still be looking at the server root.
>|
>| Thanks...   Karl
>| --
>| .NET: It's About Trust!
>| http://vfred.mvps.org
>|
>|
>|
>| > "Karl E. Peterson" <k***@mvps.org> wrote in message
>| > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl...
>| >> Hi Mike --
>| >>
>| >> Yeah, that's the general idea.  The problem seems to be if I need to use a
>| >> ..\code include page in there.  (Working from memory here, as it's been a
>| >> long time since I looked at this.)  IIS in 2003/2008 is set to
>| >> automatically not allow that for fear of some sort of exploit.  Using your
>| >> names, how do you avoid having to put getpage/header/body/footer pages in
>| >> each subfolder?
>| >>
>| >> Thanks...   Karl
>| >>
>| >>
>| >> Mike Mueller wrote:
>| >>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly
>| >>> where
>| >>> you are at from the root.
>| >>> --strThisPage= Request.ServerVariables("PATH_INFO ")
>| >>>
>| >>> you could then parse the returned string and use an SQL call to get the
>| >>> info
>| >>> from your db
>| >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage
>| >>> &
>| >>> "')"
>| >>>
>| >>> and then you can use that info to fill in your page.I would probably make
>| >>> this a function and use it in an include, to make the page lighterweight.
>| >>> I
>| >>> use a similiar strategy in several sites that I work with- ending up with
>| >>> a
>| >>> code working off of this logic:
>| >>>
>| >>> -virtual include getpage
>| >>>
>| >>> -virtual include header
>| >>> <title><%=strTitle%></title>
>| >>> -virtual include body
>| >>> <%=strBody%>
>| >>> -virtual include footer
>| >>> and getpage has the routine to read your location, get the title and the
>| >>> body
>| >>>
>| >>>
>| >>>
>| >>>
>| >>>
>| >>>
>| >>>
>| >>> "Karl E. Peterson" <k***@mvps.org> wrote in message
>| >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
>| >>>> Hi Folks --
>| >>>>
>| >>>> Old problem I'm considering revisiting.  Say I have a bunch of "topics"
>| >>>> and would like each to share a common code base but be accessed through
>| >>>> their own folders. IOW, something like this:
>| >>>>
>| >>>>   http://domain.org/subfolder/topicX/
>| >>>>   http://domain.org/subfolder/topicY/
>| >>>>   http://domain.org/subfolder/topicZ/
>| >>>>
>| >>>> The content can all be generated from a database and some ASP code.  So,
>| >>>> what I'd really like to do is have an extremely simple index.asp in each
>| >>>> folder that determined it's own folder name ("topicX"), and used this as
>| >>>> a
>| >>>> key to pass to a common code base to generates the rest of the content.
>| >>>> Problem is, as my hazy memory recalls, calling code in a parent
>| >>>> directory
>| >>>> (..\code) is considered a potential security hazard, and IIS is set to
>| >>>> prevent it.  Is there a better design, that doesn't involve replicating
>| >>>> the code in each and every subfolder?  (Am I making any sense at all?
>| >>>> <g>)
>| >>>>
>| >>>> Thanks...   Karl
>| >>>> --
>| >>>> .NET: It's About Trust!
>| >>>> http://vfred.mvps.org
>| >>
>| >> --
>| >> .NET: It's About Trust!
>| >> http://vfred.mvps.org
Author
10 Jan 2009 4:32 PM
Mike Mueller
Are these 2 different sites on the same server?  You can set-up a server to
share folders between multiple webs.


Show quoteHide quote
"Karl E. Peterson" <k***@mvps.org> wrote in message
news:uV13rCpcJHA.4900@TK2MSFTNGP06.phx.gbl...
> Stefan B Rusynko wrote:
>> No
>> - it always relative to the main root
>
> Yeah, that's the issue.  Can't use the same code on the test subweb and
> deployed web.  :-/
> --
> .NET: It's About Trust!
> http://vfred.mvps.org
>
>
>
>
>> "Karl E. Peterson" <k***@mvps.org> wrote in message
>> news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl...
>>| Mike Mueller wrote:
>>| > <!--#include virtual="/includes/filename.ext"-->
>>| >
>>| > and then I put all of the common code pages into the includes
>>directory.
>>| > Include Virtual is relative to the site root.
>>|
>>| Would it be relative to the root of a subweb on a test server?  (I build
>>on a
>>| subweb, and publish to a "full-blown" web.)  I thought not.  That
>>something like
>>| that would still be looking at the server root.
>>|
>>| Thanks...   Karl
>>| --
>>| .NET: It's About Trust!
>>| http://vfred.mvps.org
>>|
>>|
>>|
>>| > "Karl E. Peterson" <k***@mvps.org> wrote in message
>>| > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl...
>>| >> Hi Mike --
>>| >>
>>| >> Yeah, that's the general idea.  The problem seems to be if I need to
>>use a
>>| >> ..\code include page in there.  (Working from memory here, as it's
>>been a
>>| >> long time since I looked at this.)  IIS in 2003/2008 is set to
>>| >> automatically not allow that for fear of some sort of exploit.  Using
>>your
>>| >> names, how do you avoid having to put getpage/header/body/footer
>>pages in
>>| >> each subfolder?
>>| >>
>>| >> Thanks...   Karl
>>| >>
>>| >>
>>| >> Mike Mueller wrote:
>>| >>> You can use Request.ServerVariables("PATH_INFO ") to find out
>>exactly
>>| >>> where
>>| >>> you are at from the root.
>>| >>> --strThisPage= Request.ServerVariables("PATH_INFO ")
>>| >>>
>>| >>> you could then parse the returned string and use an SQL call to get
>>the
>>| >>> info
>>| >>> from your db
>>| >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" &
>>strThisPage
>>| >>> &
>>| >>> "')"
>>| >>>
>>| >>> and then you can use that info to fill in your page.I would probably
>>make
>>| >>> this a function and use it in an include, to make the page
>>lighterweight.
>>| >>> I
>>| >>> use a similiar strategy in several sites that I work with- ending up
>>with
>>| >>> a
>>| >>> code working off of this logic:
>>| >>>
>>| >>> -virtual include getpage
>>| >>>
>>| >>> -virtual include header
>>| >>> <title><%=strTitle%></title>
>>| >>> -virtual include body
>>| >>> <%=strBody%>
>>| >>> -virtual include footer
>>| >>> and getpage has the routine to read your location, get the title and
>>the
>>| >>> body
>>| >>>
>>| >>>
>>| >>>
>>| >>>
>>| >>>
>>| >>>
>>| >>>
>>| >>> "Karl E. Peterson" <k***@mvps.org> wrote in message
>>| >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
>>| >>>> Hi Folks --
>>| >>>>
>>| >>>> Old problem I'm considering revisiting.  Say I have a bunch of
>>"topics"
>>| >>>> and would like each to share a common code base but be accessed
>>through
>>| >>>> their own folders. IOW, something like this:
>>| >>>>
>>| >>>>   http://domain.org/subfolder/topicX/
>>| >>>>   http://domain.org/subfolder/topicY/
>>| >>>>   http://domain.org/subfolder/topicZ/
>>| >>>>
>>| >>>> The content can all be generated from a database and some ASP code.
>>So,
>>| >>>> what I'd really like to do is have an extremely simple index.asp in
>>each
>>| >>>> folder that determined it's own folder name ("topicX"), and used
>>this as
>>| >>>> a
>>| >>>> key to pass to a common code base to generates the rest of the
>>content.
>>| >>>> Problem is, as my hazy memory recalls, calling code in a parent
>>| >>>> directory
>>| >>>> (..\code) is considered a potential security hazard, and IIS is set
>>to
>>| >>>> prevent it.  Is there a better design, that doesn't involve
>>replicating
>>| >>>> the code in each and every subfolder?  (Am I making any sense at
>>all?
>>| >>>> <g>)
>>| >>>>
>>| >>>> Thanks...   Karl
>>| >>>> --
>>| >>>> .NET: It's About Trust!
>>| >>>> http://vfred.mvps.org
>>| >>
>>| >> --
>>| >> .NET: It's About Trust!
>>| >> http://vfred.mvps.org
>
>
>
Author
12 Jan 2009 7:57 PM
Karl E. Peterson
Mike Mueller wrote:
> Are these 2 different sites on the same server?

No, I have an in-house (w2k3) server that I test webs on.  On there, they exist as
subwebs.  I suppose, I really ought to convert them over to real webs (not sure I
can do that, without invoking the good graces of the IT dept?), but originally it
was just IIS running on an NT4 workstation and things just sort of evolved.
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
11 Jan 2009 1:53 AM
Pat
Just in case you want to enable Parent Pathing, follow this KB. 
http://support.microsoft.com/kb/276548/)

Show quoteHide quote
"Karl E. Peterson" wrote:

> Stefan B Rusynko wrote:
> > No
> > - it always relative to the main root
>
> Yeah, that's the issue.  Can't use the same code on the test subweb and deployed
> web.  :-/
> --
> ..NET: It's About Trust!
http://vfred.mvps.org
>
>
>
>
> > "Karl E. Peterson" <k***@mvps.org> wrote in message
> > news:%23rZXskfcJHA.1328@TK2MSFTNGP02.phx.gbl...
> >| Mike Mueller wrote:
> >| > <!--#include virtual="/includes/filename.ext"-->
> >| >
> >| > and then I put all of the common code pages into the includes directory.
> >| > Include Virtual is relative to the site root.
> >|
> >| Would it be relative to the root of a subweb on a test server?  (I build on a
> >| subweb, and publish to a "full-blown" web.)  I thought not.  That something like
> >| that would still be looking at the server root.
> >|
> >| Thanks...   Karl
> >| --
> >| .NET: It's About Trust!
> >| http://vfred.mvps.org
> >|
> >|
> >|
> >| > "Karl E. Peterson" <k***@mvps.org> wrote in message
> >| > news:%23ZGzblccJHA.936@TK2MSFTNGP05.phx.gbl...
> >| >> Hi Mike --
> >| >>
> >| >> Yeah, that's the general idea.  The problem seems to be if I need to use a
> >| >> ..\code include page in there.  (Working from memory here, as it's been a
> >| >> long time since I looked at this.)  IIS in 2003/2008 is set to
> >| >> automatically not allow that for fear of some sort of exploit.  Using your
> >| >> names, how do you avoid having to put getpage/header/body/footer pages in
> >| >> each subfolder?
> >| >>
> >| >> Thanks...   Karl
> >| >>
> >| >>
> >| >> Mike Mueller wrote:
> >| >>> You can use Request.ServerVariables("PATH_INFO ") to find out exactly
> >| >>> where
> >| >>> you are at from the root.
> >| >>> --strThisPage= Request.ServerVariables("PATH_INFO ")
> >| >>>
> >| >>> you could then parse the returned string and use an SQL call to get the
> >| >>> info
> >| >>> from your db
> >| >>> --"SELECT pgTitle, pgBody FROM dbo.Pages WHERE (pgPath = '" & strThisPage
> >| >>> &
> >| >>> "')"
> >| >>>
> >| >>> and then you can use that info to fill in your page.I would probably make
> >| >>> this a function and use it in an include, to make the page lighterweight.
> >| >>> I
> >| >>> use a similiar strategy in several sites that I work with- ending up with
> >| >>> a
> >| >>> code working off of this logic:
> >| >>>
> >| >>> -virtual include getpage
> >| >>>
> >| >>> -virtual include header
> >| >>> <title><%=strTitle%></title>
> >| >>> -virtual include body
> >| >>> <%=strBody%>
> >| >>> -virtual include footer
> >| >>> and getpage has the routine to read your location, get the title and the
> >| >>> body
> >| >>>
> >| >>>
> >| >>>
> >| >>>
> >| >>>
> >| >>>
> >| >>>
> >| >>> "Karl E. Peterson" <k***@mvps.org> wrote in message
> >| >>> news:%236aVFPQcJHA.5412@TK2MSFTNGP04.phx.gbl...
> >| >>>> Hi Folks --
> >| >>>>
> >| >>>> Old problem I'm considering revisiting.  Say I have a bunch of "topics"
> >| >>>> and would like each to share a common code base but be accessed through
> >| >>>> their own folders. IOW, something like this:
> >| >>>>
> >| >>>>   http://domain.org/subfolder/topicX/
> >| >>>>   http://domain.org/subfolder/topicY/
> >| >>>>   http://domain.org/subfolder/topicZ/
> >| >>>>
> >| >>>> The content can all be generated from a database and some ASP code.  So,
> >| >>>> what I'd really like to do is have an extremely simple index.asp in each
> >| >>>> folder that determined it's own folder name ("topicX"), and used this as
> >| >>>> a
> >| >>>> key to pass to a common code base to generates the rest of the content.
> >| >>>> Problem is, as my hazy memory recalls, calling code in a parent
> >| >>>> directory
> >| >>>> (..\code) is considered a potential security hazard, and IIS is set to
> >| >>>> prevent it.  Is there a better design, that doesn't involve replicating
> >| >>>> the code in each and every subfolder?  (Am I making any sense at all?
> >| >>>> <g>)
> >| >>>>
> >| >>>> Thanks...   Karl
> >| >>>> --
> >| >>>> .NET: It's About Trust!
> >| >>>> http://vfred.mvps.org
> >| >>
> >| >> --
> >| >> .NET: It's About Trust!
> >| >> http://vfred.mvps.org
>
>
>
>
Author
12 Jan 2009 7:57 PM
Karl E. Peterson
Pat wrote:
> Just in case you want to enable Parent Pathing, follow this KB.
> http://support.microsoft.com/kb/276548/)

Thanks.  Yeah, that's the fallback.  I'm told by the box owner he'd "rather I
didn't", so I've been looking for a more elegant design that would allow me to avoid
that.  I have a feeling I may end up going ahead and doing that, though.
--
..NET: It's About Trust!
http://vfred.mvps.org

Bookmark and Share