Copied to clipboard

Flag this post as spam?

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


  • Lachlann 344 posts 626 karma points
    Jul 07, 2011 @ 22:00
    Lachlann
    0

    .HTM 301 redirects Hell

    Hi Guys,

    I have been having on going issues with 301 redirects from .htm pages.

    I am running a 4.5.2 website on arvixe shared hosting. I am running several domains from the same instance of umbraco. The site is running ASP.NET 4 NOT integrated pipeline (or at least that is what my control panel tells me)

    I have liased with my hosting provideer to try and get .htm mapped correctly in IIS7 but to be honest my server knowledge is limited and so i find it hard to know what to ask for.

    My situation at the moment is that any request to my site that have .htm return a completly blank page. Previous to this I was getting that Blue IIS7 404 page but my hosts changed some settings and now I am left with a blank page.

    Any suggestions, further reading etc would be really really great.

    Thanks

     

    L

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 08, 2011 @ 17:41
    Tim
    0

    I think what is happening is that they've mapped .htm file to the asp.net request pipeline, but because Umbraco doesn't pick up the .htm extension, its just returning a blank page. I can't say for 100% without looking at your site in IIS. Do you have your site set up to use extensionless URLs, or are you using .aspx page extensions? Let me know and I'll post a Rewrite rule that you can put in your urlrewriting.config file that might fix this.

  • Lachlann 344 posts 626 karma points
    Jul 08, 2011 @ 20:45
    Lachlann
    0

    Hi Tim,

    Thanks for your help. I am not running extionless urls I have tried some really explicit examples of URL redirects. directing an explicit url to a url on my site but it didnt work. I would really appreciate any examples you could give.

     

    thanks

     

    L

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 11, 2011 @ 10:07
    Tim
    0

    Hiya,

    Can you post an example of one of the 301 rules that you have that isn't working please?

  • Lachlann 344 posts 626 karma points
    Jul 11, 2011 @ 19:48
    Lachlann
    0

    Hey sure

    <add name="thingstodo"
                   redirect="Domain"
                   ignoreCase="true" rewriteUrlParameter="ExcludeFromClientQueryString"
                   virtualUrl="http://www.mydomain.com/attractions/a-page.htm"
                   redirectMode="Permanent"
                   destinationUrl="http://www.mydomain.com/things-to-do.aspx" />

     

    This doesnt seem to do anything except that sometimes it will cause my xml to unpublish so i get that "no content seems to be published" umbraco screen.

     

    L

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 12, 2011 @ 10:05
    Tim
    0

    That's a bit odd! Try the following:

    <add name="thingstodo23"
                   
    redirect="Domain"
                   
    ignoreCase="true"rewriteUrlParameter="ExcludeFromClientQueryString"
                   
    virtualUrl="~/attractions/a-page.htm"
                   
    redirectMode="Permanent"
                   
    destinationUrl="~/things-to-do.aspx"/>

    you could also try just setting up a rule for a .aspx page to see if that works. Also check for things like rules with identical names, as they won't fire.

  • Lachlann 344 posts 626 karma points
    Jul 12, 2011 @ 22:03
    Lachlann
    0

    Yeah I think i had something like that but because i am running multiple sites with different domains from the same instance of umbraco I thought I would have to be more specific.

     

    L

  • Lachlann 344 posts 626 karma points
    Jul 14, 2011 @ 21:34
    Lachlann
    0

    Okay so i have done a bit more looking and I had the web.config set to <httpErrors existingResponse="PassThrough" />

    When i took this off i get a regular grey and red 404 page. I did a bit more looking and it seems that if i run my site under .net4 integrated pipline then all pages should be handled correctly.

    BUT

    Before i switch my site over are there changes to the web config i should make? my site is running 4.5.2 any help would be aces.

     

    L

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 15, 2011 @ 10:00
    Tim
    0

    I think you can just change the site to Integrated mode, there shouldn't be anything else you need to change as far as I can remember.

  • Lachlann 344 posts 626 karma points
    Jul 18, 2011 @ 21:18
    Lachlann
    0

    Okay! That seems to have worked!

    I switched to integrated pipeline and my redirects work! When i switched to integrated pipeline though IIS7 seems to have rewritten bits of my webconfig :S

    this manifested itself as the backend not working, I discovered i was getting a 404 on the DependencyHandler.axd I found this post which solved the issue

     

    Thanks for your help Tim!

     

    L

  • Tim 1193 posts 2675 karma points MVP 4x c-trib
    Jul 19, 2011 @ 09:44
    Tim
    0

    No worries! Glad you got it working!

    :)

Please Sign in or register to post replies

Write your reply to:

Draft