+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Directory Structure + Default Homepage

Directory Structure + Default Homepage

19 posts, 0 answered
  1. WebGeek
    WebGeek avatar
    186 posts
    Registered:
    20 Dec 2006
    22 May 2007
    Link to this post
    I trying to create a directory type structure and so far so good.  How do I set the default page for the directory (or group) so that I do not get an error when I go to www.mysite.com/test?
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    23 May 2007
    Link to this post
    Hello James,

    Please follow these steps to set default page for page group:

    1. Create a group page and set it as home (for example home.aspx)
    2. Create first child of home page (for example child1.aspx). Go to More options and add an optional URL for this page (~/child1.aspx).

    Another way is to set an optional URL for home.aspx  (~/child1.aspx). You can also have a look at the screenshots for more information.

    Don’t hesitate to write if you mean something different.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. WebGeek
    WebGeek avatar
    186 posts
    Registered:
    20 Dec 2006
    23 May 2007
    Link to this post
    Thanks for looking at this, but I think we might be misunderstanding one another. 

    Working with my site structure I need to have it so that if someone goes to www.mysite.com/directory1 they do not get  a page not found error because they did not put in www.mysite.com/directory1/home.aspx.  With a standard web site, I could have named the first page of the directory default.aspx and it will work, but with sitefinity I was instructed not to use default.aspx for my page names. 

    I have tried putting home.aspx as one of my default documents in IIS, but it still does not work.  

    I need this so we can place departmental urls in print publications.

  4. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    23 May 2007
    Link to this post
    Hello James,

    As a workaround, you can set up IIS to use a wildcard application mapping.
    Then you will be able to use paths such as ~/home and ~/. Please note that you shouldn't put home.aspx as a default document in IIS.

    Follow the steps below:
    1. Open ISS.
    2. Right-click your project  virtual folder and select Properties.
    3. On the Virtual Directory tab, click Configuration >Mappings >Add.
    4. Enter the path to the isapi.dll, e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll.
    5. In the Extension field, type .* (If you are using IIS 6.0 this won't work, so do the following instead: in the Wildcard application maps fieldd, click Insert; paste the path to the isapi.dll in the Executable field; clear the Verify that file exists checkbox)
    6. Select All verbs.
    7. Clear the Check that file exists checkbox (wildcard.jpg). 
    All you have to do in Sitefinity is set your directory1 page as homepage (PageGroup.jpg) and add these two optional URLs: ~/  and ~/home .

    We will implement this in the Service Pack for sure. Also, we intend to support the both scenarios (with wildcard and with 404 custom error page), so the user can decide which one to use. In both cases the additional URLs will not be required.

    Sincerely yours,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    23 May 2007
    Link to this post
    Hello James,

    As a workaround, you can set up IIS to use a wildcard application mapping.
    Then you will be able to use paths such as ~/home and ~/. Please note that you shouldn't put home.aspx as a default document in IIS.

    Follow the steps below:
    1. Open ISS.
    2. Right-click your project  virtual folder and select Properties.
    3. On the Virtual Directory tab, click Configuration >Mappings >Add.
    4. Enter the path to the isapi.dll, e.g. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll.
    5. In the Extension field, type .*
      (If you are using IIS 6.0 this won't work, so do the following instead: in the Wildcard application maps fieldd, click Insert; paste the path to the isapi.dll in the Executable field; clear
      the Verify that file exists checkbox)
    6. Select All verbs.
    7. Clear the Check that file exists checkbox (wildcard.jpg). 
    All you have to do in Sitefinity is set your directory1 page as homepage (PageGroup.jpg) and add these two optional URLs: ~/  and ~/home .

    We will implement this in the Service Pack for sure. Also, we intend to support the both scenarios (with wildcard and with 404 custom error page), so the user can decide which one to use. In both cases the additional URLs will not be required.

    Sincerely yours,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    11 Apr 2008
    Link to this post
    I notice you said this would be fixed in a service pack release but I am still having this problem. i want to be able to navigate to site.com/subfolder and automatically see the site.com/subfolder/default.aspx file. right now if I enter site.com/subfolder, I get a 404 error. I have to type the full path of the default document.

    is there a workaround? I'm using iis 7 does that have anything to do with it?
  7. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    11 Apr 2008
    Link to this post
    oops I didn't see the last part aboutt he additional URLs, but that didn't work either I get the error:

    "All optional URLs should be unique!"

    also, I noticed that there is no "quote" nor is there and "edit" feature in the forums. is this just disabled or is it really not possible to do these basic features?
  8. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    15 Apr 2008
    Link to this post
    Hello Josh,

    The error which you receive is because you have already used this URL for another page. However, it should be unique in a project. Please, take a look at the following forum thread: URL Redirection Issue , where you can find the resolution for your issue.

    Hope this helps.

    Regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    15 Apr 2008
    Link to this post
    thank you for your reply, however the thread you linked did not offer me a resolution. The author of that post seemed to be trying to do the opposite of what I'm doing. he wanted the url to stay as site.com/subfolder instead of redirecting to site.com/subfolder/default.aspx.

    MY problem is that I go to site.com/subfolder which is set up as a page group, and when I navigate to site.com/subfolder, I get a 404 error, because it is NOT redirecting me to site.com/subfolder.aspx, but is instead looking for site.com/subfolder, which of course since it's a dynamic link, does not physically exist.

    What can I do to fix this?
  10. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    17 Apr 2008
    Link to this post
    Hi Josh,

    Adding a wild card application mapping in the web.config file of the project as follows, would fix the problem:
      <system.webServer>  
        <handlers>  
          .......  
          <add name="Wild card" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />  
          .......  
        </handlers>  
      </system.webServer>  

    If this is not exactly what you need, please check the URL Rewriting section in the User Manual. There, you can find information for advanced URL rewriting, based on code customizations.

    Hope that this helps.

    Sincerely yours,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    17 Apr 2008
    Link to this post
    well, adding the * wildcard to web.config DID fix the problem of the subfolders not loading and mapping to the default.aspx... however now none of the theme elements work. the page loads fully with all the correct content, however there are no images, no stylings, no backgrounds, nothing. it's just plain white text because it's not loading the themes correctly. is there an additional step I must take if my site uses themes?

    thank you for your reply. while I wait for you to get back to me on this followup I will begin to look at the rewriting and hopefully find a fix there.
  12. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    17 Apr 2008
    Link to this post
    okay I've reviewed the url rewriting section, especially the part about extensionless urls and I think that's the way to go...

    I'm assuming that what I'm essentially doing is sending all 404 requests to a page which inspects the raw url and redirects the user to the correct page by appending default.aspx to it, and I would assume sets a 301 redirect...

    but if that's so then I have two questions:

    1. what if I actually DO get a user who is trying to access a page that doesn't exist? if I set the response to 404, won't it just keep looping back to the same page?

    2. why is it necessary that I do this, has everyone who uses sitefinity had to do it? if so, why isn't this functionality built into the system already? if not, then what did I do wrong that required me to do this?

    thanks again for all your assistance, I truly, TRULY love this software!
  13. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    17 Apr 2008
    Link to this post
    haha okay I'm an idiot. being a developer my first instinct is to make things harder than they need to be. I'm sure you understand :)

    I thought that the instructions for setting up IIS meant that I simply had to map to the sf404 page which is BUILT INTO sitefinity. I was under the impression that I had to make my OWN 404 page and handle the errors myself. I just wasted a good 30 minutes here trying to do that. got pretty close too!

    I mapped to sf404.aspx and ALL IS WELL! thank you for your help!
  14. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Apr 2008
    Link to this post
    Hello,

    We are glad that the problem is solved and apologize that we were not clear enough with our answers.
    Don't hesitate to contact us if you have other questions.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  15. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    21 Apr 2008
    Link to this post
    okay i've got a follow up, I asked about it before but in my excitement, forgot to seek a definitive answer...

    mapping the 404 error to sitefinity is a great solution, but what if I actually need to show a 404 page / error message to the user?

    and while we're on that note, what if the database server goes down for some reason? I've been trying to set up a "maintenance" page but I can't seem to get it to show up when the db goes down.
  16. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    24 Apr 2008
    Link to this post
    Hello SelArom,

    After adding the 404 custom error page, all invalid requests will end up with it. This is the modification which has to be added in the web.config:

    <error statusCode="404" redirect="~/errors/pagenotfound.aspx"/> 

    Where the redirect attribute depends on the custom error's destination folder. Your question 'but what if I actually need to show a 404 page / error message to the user?' is a bit confusing to us, so can you please elaborate on what exactly is happening when you enter an invalid URL in your browser.

    When you are setting a maintenance page which represents a problem with the database, you should modify the Global.asax file placed in the project's root folder. Here is an example for setting up such page:

    void Application_Error(object sender, EventArgs e)  
    HttpContext.Current.Response.Redirect("~/YourCustomErrorPage.html"); 
     

    Where YourCustomErrorPage.html represents the message you want to show. In the example it is placed in the project's root folder.

    Hope this helps.

    Best wishes,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  17. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    24 Apr 2008
    Link to this post
    thank you for your helpful reply. I'm sorry about not being clear on what I'm trying to accomplish. so let me try again:

    okay, so I want people to be able to access pages from the folder, not just by typing in the full link. For example, if users want to go to site.com/departments/default.aspx, I would like for them to be able to just type site.com/departments or site.com/departments/. obviously since these pages do not really physically exist (because of the url rewriting), if a user types in these shortcut addresses, they will get a 404 error.

    so according to the documentation, the way to handle this is to pass the 404 error handling to sitefinity's sf404.aspx page. I went into IIS and mapped the 404 error message to redirect to ~/sf404.aspx and now, if I type in site.com/departments I do indeed get redirected to site.com/departments/default.aspx. PERFECT! it's just what I wanted!

    but, what if the user misspells departments, and instead enters site.com/deparmtents? this of course also results in a 404, which is also sent to the ~/sf404.aspx. when this page does it's magic work to find the correct page, it's not going to find it because it doesn't exist anywhere. so I want to be able to THEN show a standard 404 page error message telling the user their request could not be found.

    Now, I tried setting the customErrors in the web.config to redirect to my own ~/404.aspx page on statuscode 404. And if I do that it works! missing pages redirect to that page just great! but then, if I try doing the site.com/departments again, I get "Server Error Application" that the physical path "C:\inetpub\sitefinity\departments" doesn't exist!

    so it looks like I can either have the sf404.aspx page to catch 404s and try to find the right page, and if not throw an unfriendly error. OR I can turn on custom errors and catch all 404 errors, but then I lose the ability to map to extensionless pages like site.com/departments.

    is there a way to get both?

    thanks!
  18. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    25 Apr 2008
    Link to this post
    okay I'm not sure what exactly I was doing wrong, but now it's working. putting in an existing logical path without a default.aspx DOES forward to the default.aspx. putting in a non-existant link now DOES give me the custom 404 error...

    weird, but I guess the important thing is that it works! sorry to stretch this out so long. it works now!!

    :)
  19. Sarah Masood
    Sarah Masood avatar
    19 posts
    Registered:
    18 May 2010
    11 Jun 2010
    Link to this post

    hi

    i add connection string in web.config like this

     

    <

     

    add name="somename" connectionString="somedatasource; Initial Catalog=testdb; User ID=testdb; Password=Ti9nG*" providerName="System.Data.SqlClient"/>

     

    </

     

    connectionStrings>

    Now when i run my site from ProgectManager then it shows Default.aspx(see attachment) ,instead of Home.aspx to which i set it home page in sitifinity ,  

     

Register for webinar
19 posts, 0 answered