views:

1115

answers:

6

This isn't really a programming question but more about programming and testing tools.

Is there a way to get Firefox to send the header

Host: mydomain.com

when accessing a page at

http://ip.address.goes.here/

so that Apache can route it to the correct VirtualHost?

A: 

Perhaps you could write something using Greasemonkey - such as prompting for the required hostname to send or hard-coding a list - and map it to that IP address?

Why would you be using the IP address if you need the hostname?

atc
+2  A: 

Have you tried the Modify Headers Firefox extension?

Ian Oxley
A: 

I guess you could use the TamperData extension to manually add it each time.

blowdart
A: 

Just setup an entry in the hosts file. Always worked for me :)

leppie
+2  A: 

You can add the host name and ip-address to your hosts file.

huusom
NOTE: This is one of the few situations where editing your hosts file is justifiable. (Many times people edit their host files, it is a bad idea).
benc
Sometimes you have more than one machine you want to access with the same Host header (dev,test,prod). In such cases, hosts file editing is not really an option.
itsadok
A: 

If you are creating a site and wish to map the host header to an IP (perhaps your local dev box) for testing purposes, then you should consider editing the hosts file instead.

RichardOD