Copied to clipboard

Flag this post as spam?

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


  • Greg Berlin 818 posts 634 karma points
    Feb 14, 2013 @ 00:33
    Greg Berlin
    0

    UrlRewriting to a subdirectory

    I have 3 domains pointed to my umbraco website (each setup as hostnames on separate websites within Umbraco), but I'm trying to force umbraco to log in on a specific domain, regardless of which domain the visitor browses to.

    This is my code:

        <add name="301_umbracoAdmin"
                 redirectMode="Permanent"
                 redirect="Application"
                 ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
                 virtualUrl="http://firstdomain.com/umbraco/(.*)"
                 destinationUrl="http://otherdomain.com/umbraco/$1" />
    
    However this always redirects the user to:
     http://otherdomain.com/$1 (eg: http://otherdomain.com/login.aspx) - it leaves out the /umbraco subdirectory
    I've also tried this:
        <add name="301_umbracoAdmin"
                 redirectMode="Permanent"
                 redirect="Application"
                 ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"
                 virtualUrl="http://firstdomain.com/umbraco/login.aspx"
                 destinationUrl="http://otherdomain.com/umbraco/login.aspx" />

    But it does the same thing.

    Any idea what i'm doing wrong?

  • Paul Blair 466 posts 731 karma points
    Feb 14, 2013 @ 01:01
    Paul Blair
    100

    one possibility is that if you have tried a couple of different redirects your browser is still caching the first one (e.g. if you missed out the /umbraco the first time you tested it.) The first thing I would change is the redirectMode from "permanent" to "temporary" while you are working on this problem.

    Your browser is still likely caching the permanent redirect though. Try it again in Incognito mode on your browser. This is a very handy mode for testing anything like this.

    i.e. It's possible what you have set up now is correct but caching is stuffing you up

  • Greg Berlin 818 posts 634 karma points
    Feb 14, 2013 @ 01:42
    Greg Berlin
    0

    Ah yes, very good advice, thanks Paul.  It was in fact a caching issue.  :)

Please Sign in or register to post replies

Write your reply to:

Draft