Article 58HN9 Forward IP address to domain name.

Forward IP address to domain name.

by
n00b_noob
from LinuxQuestions.org on (#58HN9)
Hello,
I'm using CentOS 8 and When I visit my website by its IP address the welcome page of Apache showed, but with "https://domain-name.net" everything is OK. How can I block direct access by IP or forward it to domain?
I enabled "mod_rewrite" and configuration is:
Code:RewriteEngine on
RewriteCond %{SERVER_NAME} =mydomain.com [OR]
RewriteCond %{SERVER_NAME} =www.mydomain.com
RewriteCond %{HTTP_HOST} ^"Server IP Address"
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]But, not worked!
How can I do it?

Thank you.latest?d=yIl2AUoC8zA latest?i=C0vHHO2axvo:1b8SW7F6VfY:F7zBnMy latest?i=C0vHHO2axvo:1b8SW7F6VfY:V_sGLiP latest?d=qj6IDK7rITs latest?i=C0vHHO2axvo:1b8SW7F6VfY:gIN9vFwC0vHHO2axvo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments