I am working on a web application which contain 2 site collections , with the following URLs:-

* `http//servername`
* `http://servername/HR`

and the second site collection have two subsites , with the following url:-

* `http://servername/HR/Staff`
* `http://servername/HR/manager`

now all of the above 4 sites (2 site collections + 2 subsites) have a site logo. now the default behavior is that clicking on the logo will redirect to the home page of the current site, either a site collection or sub site.

so i need to force the logo image to allow redirect to the root site collection , so i wrote the following script :-

```
$(document).ready(function () {

    $("a.ms-siteicon-a").attr("href", "/");
    $("a.ms-siteicon-a").attr("onclick", "");
});

```

and i reference it inside all the sites master pages. but i got this behavior;-

1. on IE the above script will work on the site collection. so if i am inside the HR site collection and i click on the logo i will redirect to the root `http://servername/` instead of `http://servername/HR/` which is correct. while on firefox the logo for the HR will keep redirecting to `http://servername/HR`
2. on both IE & Firefox, if i am inside a sub site such as `http://servername/HR/staff` the logo will keep redirecting to the subsite home page instead of the root as mentioned on the script.

so can anyone adivce how to force the logo on all the sites to always redirect to the root ?

Thanks