Copied to clipboard

Flag this post as spam?

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


  • Matt 10 posts 70 karma points
    Aug 26, 2013 @ 04:17
    Matt
    0

    .htm Rewrite

    Trying to get v2 working with 6.14.

    Out of the box it seems .htm does not even hit url tracker which makes sense.

    I add a rewrite rule for .htm in UrlRewriting.config:

    <add name="simbientUrls"
              virtualUrl="^~/(.*)\.htm"
              rewriteUrlParameter="ExcludeFromClientQueryString"
              destinationUrl="newpath/$1"
              ignoreCase="true" />

    Eg. yoursite/xxxx.htm gets rewritten to yoursite/newpath/xxxx/

    Then I set a 301 tracking from yoursite/newpath/xxxx/ to /new-xxx-article/

    Now when I hit yoursite/xxxx.htm I get a 404 saying yoursite/newpath/xxxx/ does not exist.

    Looking at the log files I can see:

    Incoming Url: yoursite/xxxx.htm

    No match found, logging as 404 not found

    Shouldn't Url Tracker be looking at the re-written Url, not the original?

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Aug 26, 2013 @ 10:07
    Stefan Kip
    0

    I'm not sure if the UrlTracker should be looking at the re-written URL, it's using Request.RawUrl at the moment, which is the non-rewritten URL, because most of the times that's the 'nice' version of a URL.
    Anyway, '.htm' should work and as you can see the xxxx.htm request does hit the UrlTracker:

    Incoming Url: yoursite/xxxx.htm

  • Matt 10 posts 70 karma points
    Aug 26, 2013 @ 13:02
    Matt
    0

    That's my point - without the UrlRewriter .config the request doesn't hit the UrlTracker.

    I suppose the real question is - how do I get the UrlTracker to process .htm requests?

     

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Aug 26, 2013 @ 13:08
    Stefan Kip
    0

    You don't have to do anything, the UrlTracker already processes all requests. The request has to have a 404 status code when the UrlTracker handles it.
    It works fine for me:

    2013-08-26 13:08:21,174 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | EndRequest start
    2013-08-26 13:08:21,175 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | Response statusCode is 404, continue URL matching
    2013-08-26 13:08:21,175 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | Incoming URL is: xxxx.htm
    2013-08-26 13:08:21,210 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | Current request's rootNodeId: 1046
    2013-08-26 13:08:21,224 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | URL match found
    2013-08-26 13:08:21,224 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | Redirect url set to: newpage
    2013-08-26 13:08:21,224 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | PassThroughQueryString is enabled
    2013-08-26 13:08:21,225 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | Redirect http code set to: 302
    2013-08-26 13:08:21,225 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | Response statuscode set to: 302
    2013-08-26 13:08:21,225 [41] DEBUG InfoCaster.Umbraco.UrlTracker.Helpers.UrlTrackerLoggingHelper - UrlTracker HttpModule | Response redirectlocation set to: http://alt1.urltracker.local/newpage
    
  • Matt 10 posts 70 karma points
    Aug 27, 2013 @ 08:28
    Matt
    0

    Yeah - there's some other configuration I'm missing.  When I browse .htm I get the .Net 404 page, not the Umbraco 404 page.

    It's like .htm is not even reaching umbraco.

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Aug 27, 2013 @ 08:59
    Stefan Kip
    0

    That's normal AFAIK. I think you're missing this setting in the web.config:

    <modules runAllManagedModulesForAllRequests="true" />
    

    See this for more info: http://stackoverflow.com/questions/11048863/modules-runallmanagedmodulesforallrequests-true-meaning

    If not, please clear the most recent umbraco log file (App_Data\Logs\UmbracoTraceLog.txt) and request the .htm page again, then post the content of the new UmbracoTraceLog.txt file here, so we can have a look together.

  • Matt 10 posts 70 karma points
    Sep 10, 2013 @ 04:40
    Matt
    0

    OK - sorry about the delay.

    I have <modules runAllManagedModulesForAllRequests="true">

    I have removed all entries from UrlRewriting.config

    There is nothing in the log file when I browse .htm - it is empty.  I get back:

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

    Requested URL: /journal/xxxx.htm

    The Url Tracker is definitely not being hit.

     

  • Matt 10 posts 70 karma points
    Sep 10, 2013 @ 07:22
    Matt
    100

    Ok - it now seems to be working - I was doing this testing on Cassini.

    When I ran locally using IIS, all started working.

     

    thanks

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Sep 10, 2013 @ 10:05
    Stefan Kip
    0

    Ok, that explains. Could you mark this topic as solved? (you can mark your own last reply as 'the answer')

  • 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