Copied to clipboard

Flag this post as spam?

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


  • Ayo Adesina 419 posts 1001 karma points
    Oct 06, 2014 @ 13:44
    Ayo Adesina
    0

    .aspx URLS giving 404 - Umbraco 6.2.1

    Hey guys,

    I have just started working on an existing umbraco project built by another developer, the project is using version 6.2.1.

    In the root of the website I have a aspx file but when I try to browse the page:

    Example: wwww.mywebsite.com/myfile.aspx I get a 404
    

    I have a txt file in the same location and this works:

    Example: www.mywebsite.com/myfile.txt   < WORKS I CAN SEE THE PAGE.
    

    I have had a look at the UrlRewriting.config file and I found this.

    <add name="301RedirectDirUrls"
        redirectMode="Permanent"
        redirect="Application"
        ignoreCase="true"
        rewriteUrlParameter="IncludeQueryStringForRewrite"
        virtualUrl="^\/(?!(umbraco\/|data\/|install\/|usercontrols\/|umbraco_client\/))(.*)\.aspx"
        destinationUrl="$1/$2" />
    

    Is this rule stooping my aspx URLs not to work?

    How can I have a seprate aspx file inside my umbraco site that responds to:

    wwww.mysite.com/myfile.apsx
    

    thanks in advance.

    Ayo

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 06, 2014 @ 14:10
    Stefan Kip
    1

    Yes, the rule is stopping your aspx URLs and you could've found out by just removing the rule. Why didn't you try that?

  • Ayo Adesina 419 posts 1001 karma points
    Oct 06, 2014 @ 14:29
    Ayo Adesina
    0

    Because I am a doughnut..

    thanks, working now!

  • Ayo Adesina 419 posts 1001 karma points
    Oct 06, 2014 @ 14:42
    Ayo Adesina
    0

    I have now realized I need the URL re-writing rule, but I want to exlude ONE URL

    So if some one requests

    www.mywebsite.com/myfile.aspx I want it to be processed all other *.aspx urls I don't. Can someone point me in the direction of how to modify this URL rule to achieve this:

    <add name="301RedirectDirUrls"
        redirectMode="Permanent"
        redirect="Application"
        ignoreCase="true"
        rewriteUrlParameter="IncludeQueryStringForRewrite"
        virtualUrl="^\/(?!(umbraco\/|data\/|install\/|usercontrols\/|umbraco_client\/))(.*)\.aspx"
        destinationUrl="$1/$2"
    
         />
    
  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 06, 2014 @ 14:52
    Stefan Kip
    0

    ^/(?!((?:(?:umbraco|data|install|usercontrols|umbraco_client)/)|(?:myfile|yourfile|somefile)\.))(.*)\.aspx

    But this should be enough:

    ^/(?!((?:(?:install|umbraco|umbraco_client)/)|(?:myfile)\.))(.*)\.aspx

  • Ayo Adesina 419 posts 1001 karma points
    Oct 06, 2014 @ 15:05
    Ayo Adesina
    0

    Thanks....

    and just out of interest...

    If I wanted to redirect a specific URL to another URL

    so...

    for example www.website.com/myfile.xml will redirect the user to www.website.com/myfile.aspx

    the myfile.aspx will then run some c# code and return myfile.xml

    Is this possible? Will it work? at the moment when a user goes to www.website.com/myfile.aspx the browser automatically downloads a xml file (witch is what I want)

    Ultimately when a user requests www.website.com/myfile.xml I want the myfile.aspx to run and return the dynamically generated xml file.

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 06, 2014 @ 15:12
    Stefan Kip
    0

    I could tell you, but you wouldn't learn anything out of it.
    Instead, this URL should help you create the rule you want: http://weblogs.asp.net/scottgu/tip-trick-url-rewriting-with-asp-net

  • Faiyaz 19 posts 39 karma points
    Nov 12, 2014 @ 16:00
    Faiyaz
    0

    Hello

     

    My Umbraco version

    umbraco v 4.0.3 (Assembly version: 1.0.3625.27276)


    My setting in web.config is as below

    <add key="umbracoUseDirectoryUrls" value="false"/>

     

    below URL works

    http://www.qihub.scot.nhs.uk/improvement-journey.aspx

     

    but the one below (with out .aspx) is throwing error "Page cannot be found"

    http://www.qihub.scot.nhs.uk/improvement-journey

     

    How can you make it work for with the .aspx.

     

    Thanks for help

    Faiyaz

     

     

    Our users want

     

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Nov 12, 2014 @ 16:05
    Stefan Kip
    0

    You said it already works with .aspx....

  • Faiyaz 19 posts 39 karma points
    Nov 12, 2014 @ 16:12
    Faiyaz
    0

    Apologies,

     

    The users want it to work with out ".aspx" in the URL.

     

    Faiyaz

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Nov 12, 2014 @ 16:12
    Stefan Kip
    0

    In that case umbracoUseDirectoryUrls should be set to true.

  • Faiyaz 19 posts 39 karma points
    Nov 12, 2014 @ 16:15
    Faiyaz
    0

    I tired that, unfortunaely not working.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies