Redirecting IP to Domain Name

JGreen

Registered
Apr 8, 2021
3
1
1
Canada
cPanel Access Level
Website Owner
So here goes nothing.

This is not exactly life and death, but when we moved from Shared hosting to VPS a while back, we created a redirect so that our IP address would load up our domain/website, rather than hitting the Apache 404 page (you know, the one that says "SORRY, If you are the owner of this website, please contact your hosting provider...).

At the time, some kind soul on a forum not unlike this one had the answer posted. It might have actually been this one, but I can't find the post. Only, it wasn't via .htaccess nor was it done with mod_rewrite, and it wasn't done via WHM or Cpanel but just ssh'd into the box. Probably not the proper way to do it, but it was quick and easy and worked.

Now, we'd actually like the IP to not load the site... pretty sure this was a matter of just quickly editing a single file, but can't recall which one. Any tips?
 

cPDavidL

Linux Analyst II
Oct 15, 2012
79
18
133
cPanel Access Level
Root Administrator
Greetings!

The behavior you're describing could have been done in a variety of means. With .htaccess/mod_rewrite ruled out, then it most likely was done via include file


Those would be the places I would start with.
 

JGreen

Registered
Apr 8, 2021
3
1
1
Canada
cPanel Access Level
Website Owner
Thanks David. Unfortunately that doesn't appear to be it either.

Due to the passage of time and a fuzzy memory, it's hard to really narrow it down, but it was as simple as adding the IP to a config/similar file somewhere. Wasn't the httpd.conf however. I know this is kind of a needle in a haystack, wish I had bookmarked the original post.