catalyst2 community forums  

Go Back   catalyst2 community forums > Support > Scripting Support

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 29-03-2006, 06:35 PM   #1 (permalink)
Registered User
 
Join Date: Feb 2006
Posts: 29
default page

how do I set up my website so that when a user enters the url it opens my default page in another folder?

I'm using forms authentication so a user must be logged in to view anything in the root so i've set up a folder called AllowAll. At current when a user visits the site they will automatically be bounced to my login screen but i would like another page to be viewed before this at the address given above. Is this possible? Many thanks.

Last edited by njwilli3; 06-05-2006 at 12:02 PM. Reason: remove url references
njwilli3 is offline   Reply With Quote
Old 29-03-2006, 10:16 PM   #2 (permalink)
Administrator
 
Jacob's Avatar
 
Join Date: May 2003
Posts: 1,299
Have you tried setting up a redirect from the main wwwroot to the AllowAll/Default.aspx file?
Jacob is offline   Reply With Quote
Old 30-03-2006, 05:23 PM   #3 (permalink)
Registered User
 
Join Date: Feb 2006
Posts: 29
that's great thanks
njwilli3 is offline   Reply With Quote
Old 30-03-2006, 08:49 PM   #4 (permalink)
Registered User
 
Join Date: Feb 2006
Posts: 29
wups

actually didn't work, If i put a redirect on the index page (the login & home page) then everytime i want to go to this page it will redirect to default.aspx. I only want default.aspx to be displayed when a user visits my website.

Last edited by njwilli3; 06-05-2006 at 12:00 PM. Reason: remove url references
njwilli3 is offline   Reply With Quote
Old 30-03-2006, 08:50 PM   #5 (permalink)
Administrator
 
Jacob's Avatar
 
Join Date: May 2003
Posts: 1,299
So then, I would suggest you get the script to check the address in the address bar and then redirect dependant on that.
Jacob is offline   Reply With Quote
Old 30-03-2006, 09:46 PM   #6 (permalink)
Registered User
 
adam's Avatar
 
Join Date: Jan 2003
Location: UK
Posts: 181
script in good old ASP code if it helps:
Code:
<%
if Request.ServerVariables("server_name") = "www.yourdomain.com" then
	response.redirect("http://www.yourdomain.com/AllowAll/Default.aspx"
end if
%>
adam is offline   Reply With Quote
Old 03-04-2006, 04:04 PM   #7 (permalink)
Registered User
 
Join Date: Feb 2006
Posts: 29
error

thanks for the help but I've gone for changing my folder structure so that my forms authentication occurs in my "/Secure" folder but I seem to get the following error. Is this something you sort out at your end Jacob?

Server Error in '/' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:


Line 38: -->
Line 39:
Line 40: <authentication mode="Forms">
Line 41: <forms name=".ASPXAUTH" loginUrl="Index.aspx" />
Line 42: </authentication>

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300

Last edited by njwilli3; 06-05-2006 at 11:58 AM. Reason: to remove url references
njwilli3 is offline   Reply With Quote
Old 03-04-2006, 06:47 PM   #8 (permalink)
Administrator
 
Jacob's Avatar
 
Join Date: May 2003
Posts: 1,299
Can you open a ticket with the URL of that error and we will take a look.

Regards,

Jacob
Jacob is offline   Reply With Quote
Old 04-04-2006, 09:29 PM   #9 (permalink)
Registered User
 
Join Date: Feb 2006
Posts: 29
something quite useful - page authorisation

after surfing many sites looking for an answer to allowing more than 1 un-authenticated page to be viewed before a user logs in i came accross this which allows for URL authorisation. I've found it extremely useful for my problem. See following post:

Emergency-Form level authentication
2004-06-10 16:38:26 altanic [Reply | View]

look into the URLAuthorization stuff. I don't claim to have a solid handle on this but I've accomplished a working example on doing exactly what you guys ask for by setting each file/folder's authorization settings in the web.config file.

You would want to add an element such as:
<location path="PublicPage.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>

for each item/folder you want to be freely available to everybody. Conversely, you could open your whole site to allow users="*" and then change the above to:

<location path="protected_directory">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

so as to protect this one directory. (or page if you like)

Thought it could be potentially usefull for others. More details of this post can be found at http://www.ondotnet.com/pub/a/dotnet...rmsauthp1.html
njwilli3 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:00 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.