Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache + Disable DNS

Status
Not open for further replies.

mikedaruke

Technical User
Joined
Mar 14, 2005
Messages
199
Location
US
Question I am running Apache and want users only to be able to connect to my machine via an IP address not a Doman name.

I am running this on an internal network where my computer name.domain is allowing users to view my page. I would like for them to be forced to use my IP address only.

Can it be done?
 
I don't know of a way to do this easily. You might be able to write a .htaccess using mod_rewrite and check the request for your IP, then redirect to a 404 page if the IP doesn't match.

I haven't tried that but it could work.

Why do you want to do this? If you don't want people on the LAN to view the stuff on your local website, you could always bind apache to localhost.
 

Disregarding the whys, I believe that you can turn on RewriteRule, RewriteEngine. You can check the HTTP_HOST value is not an IP address ( Guess here, that the ascii representation is the value in HTTP_HOST when just the
IP is typed in the URL, but I assume it is so)

gene
 
elgrandeperro: Yes, that's exactly what I was thinking as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top