2 projects in same webroot

F

Francois Soucy

I've 2 projects in same WEbRoot. Each project has is own Subdirectory.
Project #1: /Journal/ '<-- Anonymous
/Journal/Admin/ ' <-- WebForm Authentication for each web
page

Project #2: /Recettes/ '<--- Anonymous
/Recettes/Admin/ '<--- WebForm Authentication for each web
page

I've a Web.Config file that work perfectly for Form authentication. But I
really don't know how to add security for my second project. I ask this
because the hosting server only allow ONE (1) web.Config file in webroot
folder... I show you my present Web.Config file. The two project must have
distinct login page and if possible distinct custom error page... They are
completly different in subject and design.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.web>
<pages validateRequest="false" />
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="On" defaultRedirect="Journal/Err.aspx">
<error statusCode="404" redirect="Journal/Err.aspx" />
<error statusCode="403" redirect="Journal/Err.aspx" />
</customErrors>
<authentication mode="Forms">
<forms loginUrl="Journal/admin/Login.aspx" path="/">
</forms>
</authentication>
</system.web>
<location path="Journal/Admin">
<system.web>
<authorization>
<deny users ="?" />
</authorization>
</system.web>
</location>

</configuration>


The only thing I think is to add some kind of location to the main
<configuration> tag . I'm in the right direction?
Thanks
Francois
 
J

John Saunders

Francois Soucy said:
I've 2 projects in same WEbRoot. Each project has is own Subdirectory.
Project #1: /Journal/ '<-- Anonymous
/Journal/Admin/ ' <-- WebForm Authentication for each web
page

Project #2: /Recettes/ '<--- Anonymous
/Recettes/Admin/ '<--- WebForm Authentication for each web
page

I've a Web.Config file that work perfectly for Form authentication. But I
really don't know how to add security for my second project. I ask this
because the hosting server only allow ONE (1) web.Config file in webroot
folder... I show you my present Web.Config file. The two project must have
distinct login page and if possible distinct custom error page... They are
completly different in subject and design.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.web>
<pages validateRequest="false" />
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="On" defaultRedirect="Journal/Err.aspx">
<error statusCode="404" redirect="Journal/Err.aspx" />
<error statusCode="403" redirect="Journal/Err.aspx" />
</customErrors>
<authentication mode="Forms">
<forms loginUrl="Journal/admin/Login.aspx" path="/">
</forms>
</authentication>
</system.web>
<location path="Journal/Admin">
<system.web>
<authorization>
<deny users ="?" />
</authorization>
</system.web>
</location>

</configuration>


The only thing I think is to add some kind of location to the main
<configuration> tag . I'm in the right direction?

Can't you just add

<location path="Recettes/Admin">
</location>
 
W

WJ

Francois Soucy said:
I've 2 projects in same WEbRoot. Each project has is own Subdirectory.
Project #1: /Journal/ '<-- Anonymous
/Journal/Admin/ ' <-- WebForm Authentication for each web
page

Project #2: /Recettes/ '<--- Anonymous
/Recettes/Admin/ '<--- WebForm Authentication for each web
page

I've a Web.Config file that work perfectly for Form authentication. But I
really don't know how to add security for my second project. I ask this
because the hosting server only allow ONE (1) web.Config file in webroot
folder...

You can create two Web.Config files that are specifi to project and place
each under project#1 & #2 respectively. These specific Web.Config files will
overide the master under the webroot.

John
 
F

Francois Soucy

John Saunders said:
Can't you just add

<location path="Recettes/Admin">
</location>
Yes I can but user will then be redirected to /Journal/Admin/login.aspx ...
I don't want this. The two project ARE different in design and purpose.
Users that try to access a page in /Recettes/Admin/ MUST be redirected to
/Recettes/Admin/Login.aspx


Francois
 
F

Francois Soucy

Hi,

As mentioned in my previous post, my webhosting only allow me ONE
web.Config file in webroot... So I can't use this solution
 
J

John Saunders

Francois Soucy said:
But
Yes I can but user will then be redirected to /Journal/Admin/login.aspx ....
I don't want this. The two project ARE different in design and purpose.
Users that try to access a page in /Recettes/Admin/ MUST be redirected to
/Recettes/Admin/Login.aspx

Ok, then the other poster's suggestion about web.config files in the
Recettes and Journal directories should work for you. Each one can specify
the <forms> element appropriate to itself.

You are probably aware that web.config files are hierarchical, but I thought
I'd mention it just in case. You can have one web.config in the web root,
and the only thing you'll need to change in the Recettes and Journal
web.config files is what's different from the web root web.config.
 
W

WJ

Francois Soucy said:
As mentioned in my previous post, my webhosting only allow me ONE
web.Config file in webroot... So I can't use this solution

In such case, I would give my business to a new Web Host that does.

John
 
J

John Saunders

Francois Soucy said:
Hi,

As mentioned in my previous post, my webhosting only allow me ONE
web.Config file in webroot... So I can't use this solution

I'm sorry, that doesn't make sense. It's not _possible_ to have more than
one web.config in a single web root (directory), but I can't think of any
reason why a web hoster would prevent you from putting one in a
subdirectory. Perhaps you are misunderstanding their rule, or they are
misunderstanding web.config files?
 
F

Francois Soucy

No. I don't want more than one in webroot. I can only put ONE web.config
file. This file can only be in webroot.. My web hosting only permit this
only file...
 
J

John Saunders

Francois Soucy said:
No. I don't want more than one in webroot. I can only put ONE web.config
file. This file can only be in webroot.. My web hosting only permit this
only file...

Like I said, there's something wrong here. I don't understand why your web
hosting company would object to having a second web.config file, this one in
the /Recettes directory. Does the web hoster give a reason for this?
 
J

John Saunders

Francois Soucy said:
No they didn't give any reason. I give you the Fact about this:
http://www.brinkster.com/Kb/Kb.asp?kb=81832

As you see i'm hosted with brinkster. I've 3-4 month to wait before moving
to anotherweb hosting....

I believe they're wrong, and I just sent them an e-mail telling them so. In
particular, I don't know what could stop web.config from working in a
subdirectory, even if one actually _wanted_ to create such a restriction.

Try it and find out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top