Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send Host header when accessing IP address in Firefox

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?

like image 205
Bart van Heukelom Avatar asked May 13 '09 11:05

Bart van Heukelom


People also ask

How do I view HTTP Headers in Firefox?

Chrome, Firefox, and Safari Windows: Hold down CTRL + SHIFT and press the letter i. You could also right-click the page and select Inspect from the menu.

What is host header in HTTP request?

The Host request header specifies the host and port number of the server to which the request is being sent. If no port is included, the default port for the service requested is implied (e.g., 443 for an HTTPS URL, and 80 for an HTTP URL). A Host header field must be sent in all HTTP/1.1 request messages.

Can host header be different from URL?

If the URL contains an IP address, the Host header should contain the same address. If the URL contains a hostname, the Host header must contain the same name.


2 Answers

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

like image 182
huusom Avatar answered Oct 03 '22 01:10

huusom


Have you tried the Modify Headers Firefox extension?

like image 37
Ian Oxley Avatar answered Oct 03 '22 00:10

Ian Oxley