Monday, April 25, 2011

How to Customize Google Country Redirect in Firefox

This article discusses about how to change Google country redirect to whatever your want from firefox permanently.

The Problem
Google automatically redirects to the Google's country domain depending on your IP address. If you are using Google search through a proxy or if you are traveling, you might have experienced this.

Solution 1: Always get results from

One way to stop Google country redirect is to visit this link: This sets a cookie in your browser announcing Google not to redirect. Now you are getting results from But this solution fails if you remove cookies in Firefox. And the other problem is that you’ll not get country-specific search features.

Solution 2: Get results from your favorite Google country domain

Firefox’s default search bar gets its configuration options (what search engine to use, what parameters to pass, etc) from XML files located in ’searchplugins’ directory in Firefox’s default directory. If you are on a Windows system this most probably be ‘C:\Program Files\Mozilla Firefox\searchplugins’. There’s an XML file for Google called ‘google.xml’. Following is the content of that file.

Google Search
XML tags hare are self-explanatory. First copy google.xml and make a new one. Lets’ call it ‘’ for examples. Then Edit ‘ShortName’, tag and rename it to something else. Let’s call is “”. Then there are two ‘Url’ tags. Leave the first ‘Url’ tag as it is since it’s used to get search suggestions. In the second tag change template attribute to template="".

Change to within '<SearchForm>' tags. This specifies the page to display if you click on the magnifying glass icon, at the left hand corner of the search bar, without any search terms.

After these changes are made, new file should look like follows.

Google LK
Google Search

If you are in a different country than Sri Lanka, use your country’s Google domain instead of
Finally, you have to select “” from the search engine list in Firefox's search bar (Click on the small traigle next to search engine logo)


  1. Dharshin, This does not work for me.
    I am quite a technical chap so your not talking to a complete noob.
    I use firefox,"FF" on a win 7 64bit
    with an open source gateway
    I have a homepage set to
    but the problem is i use ctrl+enter alot.(going to abbriviate that to "C+E")
    and when i C+E it still redirects
    is there a way in FF, about:config
    to stop from redirecting with out the addition of /ncr

    I have tried your steps above modding the xml file but it does not seem to do anything.

  2. @Daniel

    You cannot stop automatic redirection to country domain by editing the XML. It's helpful if you are using some sort of proxy like tor.

    You must use the Firefox's search bar to get your search in correct Google domain. If you just enter, it will always redirect you to the local Google domain, if you have not set the /ncr cookie.

  3. worked for me...but if you're changing the existing file rather than a copy...change the filename too.

  4. Even changing the homepage domain to doesn't work for me. I think you have to go into Control Panel and change the geographic settings to make the computer "reside in" the country you want.


Please note that comments are moderated in order to stop comment spam. Comments with unwanted links (those who are trying to use blackhat SEO) are reported as spam.