httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: [users@httpd] IP address show Apache welcome page but domain name working!
Date Thu, 24 Sep 2020 15:10:28 GMT
On Tue, Sep 22, 2020 at 3:38 AM Jason Long <hack3rcon@yahoo.com.invalid> wrote:
>
> Hello,
> 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 my Virtual Host config is:
>
> RewriteEngine on
> RewriteCond %{SERVER_NAME} =mydomain.com [OR]
> RewriteCond %{SERVER_NAME} =www.mydomain.com
> RewriteCond %{HTTP_HOST} ^"Server IP Address"

Missing an [OR[ here on 2nd condition?

> RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
>
> But problem not solved.
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message