强制HTTP服务器configuration文件中的目录

我目前已经为我的整个网站启用了SSL的Apache。 比方说,我的网站是http://example.com/托pipe在根/ var / www / html。 我想写一个规则在我的Apacheconfiguration文件redirecthttps除了http://example.com/Hello.php以外的所有内容。 任何人都可以帮忙 我没有一个.htaccess文件,所以这需要一个规则,可以写在Apacheconfiguration,或我的000-default.conf文件。

如果你有mod_rewrite可用,你可以使用如下的东西:

RewriteEngine on RewriteRule !"^/Hello.php" "https://testing.com/$1" [R,L] 

但是也可能有其他的方法。