整个xampp文件夹的https-redirect

时间:2019-03-07 16:10:33

标签: redirect https xampp

我不是网络专家,但是我花了一些时间在虚拟服务器上设置xampp服务器,并需要一些帮助:

我希望能够从Intranet外部访问phpMyAdmin,也希望从外部访问htdocs文件夹中托管的网站。

为此,我有2个端口转发规则: 端口81外部-> xamppserver端口80 端口443外部-> xamppserver端口443

到目前为止,它正在工作。 按照许多网络教程之一,我还创建了一个证书。

现在,我想将任何http请求重定向到https请求。 在许多教程中,都要求您将以下代码复制到httpd-xampp.conf中:

<IfModule mod_rewrite.c>
RewriteEngine On

# Redirect /xampp folder to https
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} xampp
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]

# Redirect /phpMyAdmin folder to https
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} phpmyadmin
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]

# Redirect /security folder to https
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} security
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]

# Redirect /webalizer folder to https
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} webalizer
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [R,L]

是否仅对整个XAMPP文件夹而不是对每个子子文件夹进行ONE重定向是否有意义?我不知道所有子文件夹/应用程序...

0 个答案:

没有答案