Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

    
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

4 Answers 4

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=

share|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
    
You need to be superuser to do that, and that will affect every user of the machine... –  Totor Jul 26 '13 at 9:27

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

share|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. –  reconbot Sep 27 '11 at 14:00

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.