I configured a hidden service and it works. But when i type the IP into a regular browser, the same web page is hosted from the apache server.
How do i prevent it from serving the http content and only serve the onion content.
Thanks
To prevent the server from being accessible from the network, you need to bind your webserver to localhost rather than to all interfaces. So for example in your apache config, instead of:
Listen 80
You need:
Listen 127.0.0.1:80