apache 2.4.29 版本,想把默认IP访问全屏蔽掉,或者跳转到外部某站,如google,http的采用如下类似方法配置,可以正常跳转了,但https://ip却总是打开为第一个域名站(非跳转),求助大佬帮看下如下配置,是哪里没配对?
- /etc/apache2/sites-enabled# cat 000-default-ssl.conf
- <IfModule mod_ssl.c>
- <VirtualHost _default_:443>
- DocumentRoot /var/www/html
- RewriteEngine on
- RewriteCond %{HTTP_HOST} ^(\d{1,3}\.){3}\d{1,3}$
- RewriteRule ^(.*)$ https://www.google.com [R,L]
- RewriteCond %{SERVER_PORT} ^443$
- RewriteRule ^/?(.*)$ https://%{SERVER_NAME}/$1 [L,R]
- ErrorLog ${APACHE_LOG_DIR}/ip_error.log
- CustomLog ${APACHE_LOG_DIR}/ip_access.log combined
- </VirtualHost>
- </IfModule>
复制代码
/var/www/html 目录下放了一个单页,跳转google的,没生效。
以上信息转载自Hostloc。
未经允许不得转载:美国VPS_搬瓦工CN2 GIA VPS » 求助大佬指点下Apache配置问题