CodeGarden 10: The sixth annual Umbraco Developer Conference
June 23-25th 2010 - free ASP.NET MVC pre-conference. Register today!

changing the umbraco directory to enhance security

2/9/2010 11:45:44 AMAvatarGarry BainLocation: Liverpool, UKposts: 112Karma: 67

Hi everyone,

I have changed the name of my /umbraco/ folder to /login/ so the user can type in www.theirdomain.com/login to bring up the Umbraco back-end. I renamed this folder, then changed the web.config setting

<add key="umbracoPath" value="/login" />

And also

<add key="umbracoReservedPaths" value="/login,/install/" />

These were the only 2 instances of /umbraco/ in the web.config file.

Now when I go to www.theirdomain.com/login - it loads fine - I log in and everything seems fine.

However, when I right click to bring up the menu - the menu disappears straight away in Firefox. This doesn't happen in IE thought. I went through my entire site and changes all  occurences of "/umbraco" or "/login" but this hasn't solved it.

Has anyone successfully done this before?

Cheers, Garry.

2/9/2010 12:00:30 PMAvatarDirk De GraveLocation: LotenhulleMVP.admin.posts: 2966Karma: 2934
Comment with ID: 25780

Read this blogpost, it may help you on this issue.

 

Cheers,

/Dirk

2/9/2010 12:01:35 PMAvatarPeter DijksterhuisLocation: Swifterbant, 8255EA, NLposts: 1280Karma: 1414
Comment with ID: 25781

Hi,

You currently cannot change the umbraco-folder since a couple of references are hardcoded to that folder.

If you rename it, a couple of javascript-files can't be found and result in the behaviour you had.

I believe that the future 4.1 does support renaming of the folder.

HTH,

Peter

2/9/2010 12:22:28 PMAvatarLee KelleherLocation: Yatton, Bristol, UKposts: 463Karma: 1357
Comment with ID: 25786

Hi Garry,

I've worked on a few Umbraco sites where we've had to change the location of the /umbraco/ folder.  Dirk's reference to Tim's blog post is great - it will sort out your context-menu issue!

An other thing I found was that if you install any 3rd-party packages, quite a lot of them make the assumption that you have an /umbraco/ folder, and will place images, css, javascripts, etc in there.  So you might need to do some manual moving around if you install any packages.

Good luck with it.

Cheers, Lee.

(PS. Good to see a fellow Scouser on the forums)

2/9/2010 3:22:39 PMAvatarGarry BainLocation: Liverpool, UKposts: 112Karma: 67
Comment with ID: 25801

Hi guys,

Thanks for the replies. I have tried the suggested addition to UrlRewriting.config using the following code

<add name="missingjs" 
    virtualUrl="^~/## login ##_client/ui/(.*).js"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="~/umbraco_client/ui/$1.js"
    ignoreCase="true" />

However, the context menu is still disappearing on right click. I have tried this on 2 test sites now and both are having the same issue. Can someone confirm that my syntax above is actually correct? I have added it just before </rewrites> as it states.

Cheers, Garry.

2/9/2010 5:16:06 PMAvatarLee KelleherLocation: Yatton, Bristol, UKposts: 463Karma: 1357
Comment with ID: 25821

Hi Garry,

Remove the extra hashes ## from the virtualUrl attribute:

<add name="missingjs" 
    virtualUrl="^~/login_client/ui/(.*).js" 
    rewriteUrlParameter="ExcludeFromClientQueryString" 
    destinationUrl="~/umbraco_client/ui/$1.js" 
    ignoreCase="true" />

I think Tim's example (from his blog post) had them to bring attention to them - they aren't used as part of the virtualUrl path.

Good luck, Lee.

2/11/2010 10:54:49 AMAvatarGarry BainLocation: Liverpool, UKposts: 112Karma: 67
Comment with ID: 26018

Hi Lee,

Thanks for the reply - I tried the code that you have given me but it still isn't working. Does anyone know of any other JS files that may need their path changing?

2/19/2010 1:59:39 PMAvatarTimLocation: Brockhampton, Herefordshire, UKposts: 11Karma: 32
Comment with ID: 26816

Hi Garry,

Just a quick question but are you mapping all requests through to the ASP.Net ISAPI within IIS? If you don't do this, IIS will handle the JavaScript files and the URL Rewriter will never be notified.

If you've not mapped all URLs through IIS this is how:

1. In IIS goto the website and click on properties
2. Select home directory tab.
3. Click configuration
4. Under wildcard application maps section click insert
5. Then click browse and select file C:\Windows\Microsoft.NET\Framework\v2.0.50727\ aspnet_isapi.dll (make sure you goto your windows folder)
6. Uncheck verify file exists
7. Click apply

Tim

 

Please login or Sign up To post replies