> ## Content Index
> Fetch the complete content index at: https://blog.tsd.digital/llms.txt
> Use this file to discover other available public pages before exploring further.

# Fix missing JavaScript file when you rename the Umbraco admin directory
- URL: https://blog.tsd.digital/fix-missing-javascript-file-when-you-rename-the-umbraco-admin-directory/
- Published: 2009-04-28T16:49:48.000Z
- Updated: 2009-04-28T16:49:48.000Z
- Author: Tim Gaunt
- Tags: ASP.Net, Security, Umbraco, Web Development, .Net, The Site Doctor, #Import 2025-04-01 05:37

## The Error

For those of you who have tried to rename your Umbraco installation directory to something other than the default /umbraco/ you'll have found that TreeInit.aspx throws a JavaScript error along the lines of:

Message: Object expected Line: 1 Char: 4236 Code: 0 URI: http://www.yourdomain.co.uk/youradmindirector/js/xloadtree.js

As this only really affects the refresh of the tree/close of a couple of dialogues I've not bothered fixing it but basically the issue is outlined well here: [http://tinyurl.com/cx9atv](http://tinyurl.com/cx9atv?ref=blog.tsd.digital)

## The Fix

If you're using extension less URLs already then it's easy as pie to sort:

1. Open your UrlRewriting config file (/config/UrlRewriting.config)
2. Add this above "</rewrites>":

<...><add name="missingjs" virtualUrl="^\~/## YOUR ADMIN DIRECTORY GOES HERE ##\_client/ui/(.\*).js" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="\~/umbraco\_client/ui/$1.js" ignoreCase="true"/>

If you've not already using extension less URLs don't panic, that's easy to setup you can [read all about it here](http://www.urlrewriting.net/160/en/documentation.html?ref=blog.tsd.digital). Alternatively you could just copy the js files from one folder to another ;)

## The Why

I don't know how many people already rename their admin dir from something else but as Umbraco becomes a more popular choice of CMS you really should consider hiding the folder (the more popular it becomes, the more people will become more familiar with the default admin directory of /umbraco/).

Although there hasn't yet been a breach (AFAIAA) if a vulnerability is found, the first step in prevention is obfuscation -hide your admin directory! A [quick Google search](http://www.google.co.uk/search?q=username+login+inurl%3Aadmin.asp&ref=blog.tsd.digital) will show you how easy some developers have made it for you to [find their admin sites](http://www.google.co.uk/search?q=username+login+inurl%3Aadmin.asp&ref=blog.tsd.digital).