Umbraco Admin problem when running multiple websites

Discussion in 'Third-party applications' started by SaintSkeeta, Mar 27, 2011.

  1. Hi,
    I have a Winhost account with 10 databases available to me, and I planned to run a couple of websites from different subfolders. I've setup the domain pointers, the application start points, and the url rewrites to make this happen, and the sites work fine.

    However, one of the websites runs on Umbraco, and when I go to the admin page of that site, the admin page is missing styling and javascript.

    Looking at the source, the CSS is normally linked in through:-
    Code:
    <link rel="stylesheet" type="text/css" href="DependencyHandler.axd?s=L2JlbnRsZWlnaGZjL3VtYnJhY29fY2xpZW50L3BhbmVsL3N0eWxlLmNzczsvYmVudGxlaWdoZmMvdW1icmFjb19jbGllbnQvc2Nyb2xsaW5nbWVudS9zdHlsZS5jc3M7L2JlbnRsZWlnaGZjL3VtYnJhY29fY2xpZW50L3VpL2RlZmF1bHQuY3NzOw%3d%3d&amp;t=Css&amp;cdv=1" />
    When I click on this link I get an exception:-
    System.ArgumentException: Could not parse the type set in the request
    When I had this Umbraco installation running from the root (before I wanted multiple sites on this account) everything worked fine. Does anyone know what might be causing this problem?

    Here is what I have done to make the multiple websites work.
    Here is the web.config in '/'
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <modules runAllManagedModulesForAllRequests="true" />
            <rewrite>
                <rules>
                    <rule name="Rewrite to website one" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^www.saintskeeta.com$" />
                        </conditions>
                        <action type="Rewrite" url="saintskeeta/{R:1}" />
                    </rule>
                    <rule name="Rewrite to website two" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^www.johndoe.com$" />
                        </conditions>
                        <action type="Rewrite" url="johndoe/{R:1}" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    Here is the section I added to the web.config in my folder '/saintskeeta'. This makes my links on this site redirect so that the subfolder is not placed in the URL.
    i.e a link will be www.saintskeeta.com/news.aspx instead of www.saintskeeta.com/saintskeeta/news.aspx.
    Code:
    <system.webserver>
    .
    .
    .
        <rewrite>
            <outboundRules>
                <rule name="Outgoing - URL paths" enabled="true">
                    <match filterByTags="A, Form, Img, Input, Link, Script" pattern="saintskeeta/(.*)" />
                    <conditions>
    
                    </conditions>
                    <action type="Rewrite" value="/{R:1}" />
                </rule>
            </outboundRules>
        </rewrite>
    </system.webServer>
    Here is the url rewrite I needed to add to the UrlRewriting.config for this Umbraco instance to get the admin page just to display.
    Code:
    <add name="saintskeetaRewrite"
    				virtualUrl="^/saintskeeta/(.*)"
    				rewriteUrlParameter="ExcludeFromClientQueryString"
    				destinationUrl="~/$1"
    				ignoreCase="true" />
    I have added Domain Pointers to each of the sites, and set the Application start points for both sites to be the subdirectories listed in the first web.config.

    As I said, the site itself works, but the umbraco admin page is missing css and js, and even when I login, I cannot do anything (supposedly because of the missing JS).

    Any ideas?
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    I believe Umbraco has some AJAX built into it and with AJAx and URL Rewrites some issues can occur. For now try calling the site without any URL rewrites and call it directly with its URL. As an example, www.mydomain.com/folder1. Lets see if this fixes the path issue.
     
  3. Hi Ray,
    I removed all the redirects and called the website directly like you said, and the umbraco admin page works fine again! (i.e when I go to www.saintskeeta.com/saintskeeta/umbraco/)

    The website however has now lost all the CSS and JS from it because of the links pointing to the root folder, instead of the /saintskeeta folder. (That's a minor issue for now anyway).

    So it does look like a redirect issue. What would you suggest I do to try and fix this issue? Maybe have an 'ignore' case for when 'umbraco' is in the URL?

    i.e I don't mind having to get to the umbraco admin with the subfolder in the URL.

    Thanks for your assistance with this issue.
     
  4. Ray

    Ray

    Hmmm, this is a tough one. If you can try uploading umbraco into your root and have it as your primary web application. Bear in mind that Umbraco is a fairly extensive application and you really need to set it as its only application else you might run into some issue with the application pool recycling.

    You may want to try looking at this post for some ideas on how to fix AJAX with redirects/rewrite rules.

    http://forum.Winhost.com/showpost.php?p=10748&postcount=20
     
    Last edited by a moderator: Oct 14, 2015

Share This Page