Copied to clipboard

Flag this post as spam?

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


  • Kyle Skrinak 272 posts 327 karma points
    Apr 12, 2011 @ 16:49
    Kyle Skrinak
    0

    urlrewriting not, um, redirecting?

    Firstly, I apologize for cross-posting, but this issue is more urgent than my usual questions.

    Using: umbraco 4.6.1: Confused. I've made the above change (tailored to my situation, of course) to conf/urlrewriting.conf, and I've used the config tree package, ensuring that I'm modifying against my live site. But the change isn't happening.

    One difference between the example and my use case is I don't need to switch domains; I'm redirecting within the app. For example:

    <urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">

      <rewrites>
        <add name="301_Redirects_for_Articles"
             redirectMode="Permanent"
             redirect="Domain"
             ignoreCase="true"
             rewriteUrlParameter="IncludeQueryStringForRewrite"
             virtualUrl="http://customsite.com/articles/articles/(.*)"
             destinationUrl="http://customsite.com/articles/$1" />
      </rewrites>

    </urlrewritingnet>

    What's the best way to troubleshoot this?

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Apr 12, 2011 @ 17:24
    Darren Ferguson
    0

    Is part of your config missing? you refer to an above change that isn't there.

    When using a virtualUrl you don't typically need to prefix with the domain name it normally takes a relative format:

     

    e.g. ~/articles/articles/(.*)

  • Kyle Skrinak 272 posts 327 karma points
    Apr 12, 2011 @ 17:45
    Kyle Skrinak
    0

    I was unclear. I copied the urlrewriting code from here. I have changed the code to this, as per your advice:

             virtualUrl="~/articles/articles/(.*)"

             destinationUrl="~/articles/$1" />

    However, I still do not see any redirection action in Firebug's "Net" section (as I do in others.) I have restarted the app pool. I'm sure I'm missing some other elementary step?

  • Kyle Skrinak 272 posts 327 karma points
    Apr 14, 2011 @ 15:27
    Kyle Skrinak
    0

    Any ideas?

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 19, 2011 @ 19:04
    Warren Buckley
    0

    Hey Kyle,
    Just so I understand the problem clearly, what are you expecting to happen when you make this change and what exactly are you trying to achieve?

    For example putting something into the URL rewrite config does not mean your umbraco node url's will automatically get rewritten for you, however if you were to type in the new URL into the address bar it will do the rewrite as needed.

    For example I have previously used an URL rewrite to have nice urls in my markup and in the address bar:
    So i have mysite.com/member/1234 to do a nice rewrite that is actually calling a page mysite.com/member.aspx?memberID=1234

    However in my XSLTs and markup throughout the site I needed to manually construct the nicer url I wanted to use

    <a href="/member/{@id}"> as opposed to <a href="/member.aspx?{@id}">

     

    I hope this helps
    Warren :)

  • Kyle Skrinak 272 posts 327 karma points
    Apr 19, 2011 @ 19:12
    Kyle Skrinak
    0

    Warren, much thanks for asking! The scenario you layout seems to be the most common practice. However, I'm looking to implement 302 redirects for pages that I have moved to new paths.

    I wish to use urlrewrite to rewrite old URLs, which are no longer active, to point to where they should point. In the example above, I you can see where I used to have URLs, and where the new URLs are. For example:

    http://customsite.com/articles/articles/10-3.pdf really should be
    http://customsite.com/articles/10-3.pdf

    and I have a directory full of such PDFs that are now throwing 404s to the googlebot, (as well as links from old sites, especially forums, where links aren't updated) where I wish they are redirects.

    It seems like I've cannonically followed the rewrite format, but it's not working.

    Thanks!

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 19, 2011 @ 22:27
    Warren Buckley
    0

    HI Kyle,
    I am no 301 redirect expert, however I think this package is more of interest to you
    http://our.umbraco.org/projects/developer-tools/301-url-tracker

    As the URL rewriter config is for content nodes that are being served from the umbraco admin, where the PDF is a normal IIS request so hence this would not get picked up. The URL rewriter config is for rewriting umbraco nodes and not old URLs, I think the 301 redirect package will help you out with that.

    Tell me if I am wrong and I have misunderstood.

    Thanks,
    Warren

  • Kyle Skrinak 272 posts 327 karma points
    Apr 19, 2011 @ 22:39
    Kyle Skrinak
    0

    OK, so I was using URL Rewriter outside of its scope. Thanks! I know I could do this on IIS, too, but I was looking to do it within umbraco.

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft