Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Court Borgman 12 posts 32 karma points
    Jan 24, 2012 @ 22:49
    Court Borgman
    0

    Yay marketing (and custom landing pages)

    Good afternoon.

    Our marketing department wants to setup custom landing pages for some of our major potential clients.  These landing pages woud basically be their own directory www.oursite.com/yourcompany/ .  Unfortunately I have been unable to make anything work that will let me load a page using just a directory (anything that is missing .aspx).

    I have tried creating a sub-node called default.aspx however since there is no physical file called default.aspx IIS just returns a basic 404 error (not even the custom one setup in umbraco).

    I have also tried setting umbracoUseDirectoryUrls to true, however this breaks the entire rest of the navigation which is already large, so this option seems to be rulled out.

    Can anybody think of, suggest, or otherwise know of anysolutions to this.  I need to just setup a few pages to load under a directory URL not under a page URL.

     

    TIA

    Court

  • Rodion Novoselov 694 posts 859 karma points
    Jan 25, 2012 @ 00:08
    Rodion Novoselov
    0

    Hi. What version do you use? Afaik, at least in most recent versions of Umbraco even with umbracoUseDirectoryUrl = false any page like "/yourcompany.aspx" is available as both "/youcompany" and "/youcompany/" as well (I've even heard some SEOs complaining about it since it's sometimes regarded as not a good thing). Also I think that if your navigation had been built in really righteous way (no hardcoded URLs but the URLs inferred from page IDs) you wouldn't have had any problem with migrating to folder-looking URLs.

  • Funka! 398 posts 661 karma points
    Jan 25, 2012 @ 01:05
    Funka!
    0

    Hi,

    When you set "umbracoUseDirectoryUrls" to true, ... did you also remember to add the blank "preCondition" to the "UrlRewriteModule's" add node under system.webServer\modules? These two need to go hand-in-hand. E.g., also change this:

    <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />

    into this:

    <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" preCondition="" />

    If this is not the problem, perhaps you could elaborate on what exactly "broke" when you did this. Rodion is correct, old paths that still have the ".aspx" on them should continue to work, assuming things are setup correctly.

    Good luck!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 25, 2012 @ 06:41
    Jeroen Breuer
    0

    Here is a quick solution. Even if you have set to umbracoUseDirectoryUrls false this will still work. Just open the UrlRewriting.config file and add this:

    <urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
        <rewrites>
            <!-- 
                Urlrewriting.Net is a cool tool, what can make your urls look nice.
                The rewriting is controlled with regular expressions. To get more help
                look at http://www.urlrewriting.net/. 
    
                Remember to read the manual! 
                http://www.urlrewriting.net/download/UrlRewritingNet20.English.pdf
            -->
    
          <add name="yourcompany"
               virtualUrl="^~/yourcompany"
               destinationUrl="~/yourcompany.aspx"/>
        </rewrites>
    </urlrewritingnet>

    This way if you go to that url it will get redirected to the url with .aspx, but in the browser it will stay without that.

    Jeroen

  • Court Borgman 12 posts 32 karma points
    Jan 25, 2012 @ 19:14
    Court Borgman
    0

    I am using version 4.5.2.  I know it's a little old but everytihng works (so far) and I've had no reason to risk downtime over an upgrade.

    I had not added preCondition="" to the urlRewriteModule httpmodule, however I tried this and I get the error "Unrecognized attribute precondtion".

    I also tried adding the rewrite to the urlrewriting.config file but this did not seem to work.

     

    the error is that when I eneable use directory URLs the navigation links to the directory instead of the aspx file.  This would be fine if the page would load by going to the directory, but it doesn't.  I just get a real 404 error when navigating to any directory.  That's about as much as I know that is going on.

    The same thing happens when I try to add the rewrite to the urlrewritting.config file.

     

    One thing I did notice upon trying to investigate this is that the/Umbraco/UrlRewriter folder is empty when I navigate to it with a file manager.  The dll is in the bin folder however.  Could this be the source of all of my problems, or am I jsut grasping at straws?

    TIA

  • Court Borgman 12 posts 32 karma points
    Jan 25, 2012 @ 20:43
    Court Borgman
    0

    Figured it out.

    After reading throughthe UrlRewriting documentation I found that I did not have the aspmet_isapi setup as a wildcard application map.  Without needing to have any of the above steps implemented the directory worked just by adding this in the sites IIS properties.

     

    To reiterate:

    Add aspnet_isapi to the Wildcar application maps in IIS and the problem is solved.

     

    Thanks all.

Please Sign in or register to post replies

Write your reply to:

Draft