Can I override a hostname in firefox? for example when I access www.example.com it should actually access localhost and not example.com

Does any add-on provide that capability?

link|improve this question
why does someone wanna close this question? Don't we have to specify a reason why someone voted to close it? – Priyank Jan 25 '10 at 6:18
feedback

migrated from stackoverflow.com Jan 25 '10 at 9:54

This question came from our site for professional and enthusiast programmers.

4 Answers

Why not just use HOSTS files, which is what everyone who wants to specify an IP address for a domain name does?

http://www.google.com/search?q=windows+hosts+file&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1

http://www.google.com/search?q=mac+hosts+file&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1

http://www.google.com/search?hl=en&rls=com.microsoft%3Aen-us&q=linux+hosts+file&btnG=Search&aq=f&aql=&aqi=&oq=

link|improve this answer
2  
I personally don't like using host files because if you are switching between a dev and production site using host files you have no way to tell what environment's host files you are using. If you use a Firefox add in in like Redirector, you can quickly see, if re-directions is happening. And host files are generally used when DNS does not work properly. In my humble opinion :) – Rihan Meij Jan 25 '10 at 5:41
Yeah, Rihan is right. My main aim is to test dev in firefox browser which should redirect to local while prod can be tested in chrome. I didn't want to modify hosts file as that would make both browser point to local. That wouldn't serve my purpose. – Priyank Jan 25 '10 at 5:48
feedback

Redirector: https://addons.mozilla.org/en-US/firefox/addon/5064 (donationware)

link|improve this answer
I tried using it and maybe I am doing something wrong; but though I could configure it, it still doesn't redirect. – Priyank Jan 25 '10 at 5:49
Can you give me any more specifics? I tried it and it did work. The download page indicates that it currently works on FF 3.5 only. – Jay Jan 25 '10 at 5:58
This doesn't do what the user asked. – wizard Sep 27 '11 at 14:00
feedback

I think that SwitchHost does exactly what you want: https://addons.mozilla.org/en-US/firefox/addon/14258

link|improve this answer
feedback

Yes, switchhost would be the one, if you are not in MAC OSX 10.5.8. with Firefox 3.5.9. and your hosts file is not longer than a single row. Adding more rows screws up the file, and all hostname values other than first one get deleted. The idea is perfect though.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown