Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Jul 23, 2009 @ 13:50
    trfletch
    0

    Have URL without .aspx on the end

    Hi,

    I wondered how I could have a URL without .aspx on the end point to one of my pages. For example http://www.mywebsite.com/test would take someone to http://www.mywebsite.com/test-homepage.aspx?

     

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 23, 2009 @ 13:56
    Simon Dingley
    1

    You can make use of the UrlRewriting module in Umbraco however getting extensionsless urls to work requires a change on your server. Are you on shared hosting? If you are it can sometimes be a problem as it is for one of my cleints hosts. 

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 23, 2009 @ 13:58
    Simon Dingley
    2

    Documentation for the UrlRewriting module can be found here:

    http://www.urlrewriting.net/160/en/documentation.html

    And you will find the config file in config/UrlRewriting.config in your site.

  • Roel Snetselaar 151 posts 305 karma points
    Jul 23, 2009 @ 14:22
    Roel Snetselaar
    1

    In your web.config set umbracoUseDirectoryUrls to true

    And like Simon says, you need to add a wildcardmapping to IIS. For IIS7 check this link: http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/

  • trfletch 598 posts 604 karma points
    Jul 23, 2009 @ 14:25
    trfletch
    0

    We host our own servers so I can make any changes on the server I want, I have added the following to the urlRewriting.config file, what else do I need to change on the server?

    <add name="produktidrewrite" 
         virtualUrl="/test"
         rewriteUrlParameter="ExcludeFromClientQueryString"
         destinationUrl="/test-homepage.aspx"
         ignoreCase="true" />
  • Tim 225 posts 690 karma points
    Jul 23, 2009 @ 14:38
    Tim
    101

    You need to add a wildcard mapping to IIS, which tells it to use the aspnet_isapi.dll to serve all pages/folders.

    To do this in II6:

    Go to IIS

    Right click on your website

    Select Properties

    Click the home directory tab

    Click Configuration

    On the mappings tab, click the Insert button, next to the wildcard mappings box

    Click Browse and find the aspnew_isapi.dll, this can usually be found here: c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll

    Untick verify that file exists and click OK

    Click OK

    Click OK

    All done!

    The IIS7 instructions can be found here http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/ as mentioned by Simon Dingley

    T

  • Tim 225 posts 690 karma points
    Jul 23, 2009 @ 14:39
    Tim
    0

    Sorry Roel, my attribution for the IIS7 instructions should have been: Roel Snetselaar

    I wish I could edit my posts!

  • Martin Bentzen 83 posts 145 karma points
    Jul 23, 2009 @ 14:46
    Martin Bentzen
    0

    There is also a good instruction of directory url in IIS7 here: http://umbraco.org/blog/2009/4/7/how-to-migrate-umbraco-40-to-iis-7-and-aspnet-35 (Section Directory urls and authentication)

  • trfletch 598 posts 604 karma points
    Jul 23, 2009 @ 15:39
    trfletch
    0

    Excellent thank you all for the help, I am in fact using IIS6 so I made the change described by Tim in IIS and made the change to UrlRewriting.config as described by Simon. Works a treat. Shame I can't make two posts the solution!

  • trfletch 598 posts 604 karma points
    Jul 23, 2009 @ 16:41
    trfletch
    0

    Hmm, it appears this is not working completely as I would like, because as soon as it see's "/test" in the url it adds "/test-homepage.aspx" some other links I have do not work, for example if a user tries to access "/test-anotherpage.aspx" it tries to take them to /test-homepage.aspx-anotherpage.aspx"

    Is there a way to resolve this? I literally only want to redirect to "/test-homepage.aspx" if someone types "/test"

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 23, 2009 @ 18:40
    Morten Bock
    0

    You probably need to change your rewrite a bit. It uses regular expressions to match the urls.

     

    <add name="produktidrewrite" 
         virtualUrl="~/test$" 
         rewriteUrlParameter="ExcludeFromClientQueryString" 
         destinationUrl="/test-homepage.aspx" 
         ignoreCase="true" />

     

    Try that. As far as I recall $ means "end of string" so it should not match /test-somethingelse type url's.

  • bob baty-barr 1180 posts 1294 karma points MVP
    Jul 24, 2009 @ 03:36
    bob baty-barr
    0

    could you also use umbracoUrlName as a docType property combined with the wildcard mapping to achieve the same on a content editor level.. .instead of the need to update the urlRewriting config all the time?

  • trfletch 598 posts 604 karma points
    Jul 24, 2009 @ 15:02
    trfletch
    0

    Hi,

    Thanks Morton, that seems to work but I have found that by adding the entry to IIS for aspnew_isapi.dll, it now means that I can no longer access the backend by going to www.mywebsite.com/umbraco. Why would this be? Does this mean I need to add an entry to UrlRewriting.config for /umbraco?

  • Tim 225 posts 690 karma points
    Jul 24, 2009 @ 15:12
    Tim
    0

    Hi,

    To access the backend you will need to go to:

    http://www.mywebsite.com/umbraco/umbraco.aspx

    T

  • trfletch 598 posts 604 karma points
    Jul 24, 2009 @ 15:17
    trfletch
    0

    I know I can access it that way but it used to be accessible by just going to /umbraco. I don't want to have to tell users that they have to access it a different way

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 24, 2009 @ 20:31
    Morten Bock
    0

    Hmm, I haven't actually tried doing a url rewrite for the admin area. But try it out and see if it works. 

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 24, 2009 @ 20:34
    Morten Bock
    0

    Something like this:

     

    <add name="adminrewrite" 
         virtualUrl="~/umbraco$" 
         rewriteUrlParameter="ExcludeFromClientQueryString" 
         destinationUrl="/umbraco/default.aspx" 
         ignoreCase="true" />

     

     

  • trfletch 598 posts 604 karma points
    Jul 27, 2009 @ 10:43
    trfletch
    0

    I was going to give that a try I just wondered why adding the aspnew_isapi.dll entry to IIS had stopped it working? Does adding that entry tell it to ignore any previous redirects or something along those lines?

  • trfletch 598 posts 604 karma points
    Jul 27, 2009 @ 16:42
    trfletch
    0

    Ok well when I add the entry to URLrewriting for the Umbraco backend, it seems to open the Umbraco login page (although instead of opening it as a pop-up window it opens it in the current window). The problem is when you login to Umbraco it doesn't really display much apart from some buttons that are missing their images. Is there a way to make it so that I get this to work for just one page without screwing up the Umbraco backend?

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 27, 2009 @ 19:25
    Morten Bock
    0

    Did the backend work before you added the rewrite rule when you were using the umbrac/umbraco.aspx url? It may be my rewrite rule that is screwing up stuff like images, css, javascript and so on.

    To answer your previous post, I think the issue is that when you add the wildcard rule to IIS, the then url /umbraco is not seen as a folder, and thus does not look for a page inside the folder (like default.aspx).

    What happens if you try to go to the url of the image that looks broken directly in the browser?

  • trfletch 598 posts 604 karma points
    Jul 28, 2009 @ 10:17
    trfletch
    0

    Yes that is what the problem is, I would assume that it is starting to see anything with /umbraco and trying to redirect it, therefore anything in the /umbraco folder can no longer be seen.

  • trfletch 598 posts 604 karma points
    Jul 28, 2009 @ 10:46
    trfletch
    0

    I have got this working a different way now, I have added a new folder into the site and put a default.aspx page in with a redirect, I have then added that folder to web.config as an UmbracoReservedURL and UmbracoReservedPath, in the Reserved url I had to put it in single quotes to stop it acting as a wildcard.

  • Sjors Pals 617 posts 270 karma points
    Jul 28, 2009 @ 11:34
    Sjors Pals
    0

    In the web.config you can set the umbracoUseDirectoryUrls on True

    You also have to change the settings in IIS

    -Go to the root of your website and click properties

    -Select tab: Home directory

    -Click configuration

    -Then click insert a new wildcard application in the bottom of that screen

    -A input box pops up, select the .net Handdler: c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll (maybe change file location)

    -Uncheck the verify file exists checkbox

  • Sjors Pals 617 posts 270 karma points
    Jul 28, 2009 @ 11:35
    Sjors Pals
    0

    Grrr did not see this was already the third page.

  • trfletch 598 posts 604 karma points
    Jul 28, 2009 @ 15:29
    trfletch
    0

    Yeah, you may want to check the previous pages, the method you described caused some additional problems but thanks anyway.

  • Jez 1 post 21 karma points
    Aug 17, 2009 @ 17:50
    Jez
    0

    When I add the wildcard in IIS my homepage breaks - I get a 500 error unless I add /home to the URL. ANy ideas why this would happen?

Please Sign in or register to post replies

Write your reply to:

Draft