Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Forwarding IP address to proper domain in Apache 2.4 / Centos 7

I want to forward any requests for my server public IP address to the domain. I have the following code near the top of the httpd.conf file. The numbers in the second line are the actual IP address of the server.

However, when I visit the IP address in my browser, (1.2.3.4 in this example case) the website comes up with the IP and no https. Why does this code below not forward the request to the domain with https?

If the user visits http:// or https://1.2.3.4 I want them to be redirected to https://www.example.com.

# Rewrite engine to move the raw IP address to URL
RewriteEngine On
RewriteCond %{HTTP_HOST} ^1\.2\.3\.4$
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!