我已经用 RewriteRule 编辑了 httpd.conf,它看起来像这样:
<VirtualHost myip:80>
ServerName mysite.com
ServerAlias mail.mysite.com www.mysite.com
RewriteEngine on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
JkMount /* mysite
...
它工作正常,但是当重建 httpd.conf 时,我所做的所有更改都丢失了。我尝试编辑 pre_virtualhost_global.conf 但没有成功,如果有人能确切地告诉我我必须放什么以及放在哪里,我将不胜感激。
感谢您的宝贵时间。
最佳答案
您提到有一个 pre_virtualhost_global.conf
文件,所以我假设您有 WHM/cPanel。为了修改 Apache 虚拟主机,您使用包含文件,如 WHM/cPanel 的 official documentation 中所述。 .
关于linux - 在 httpd.conf 中保留 VirtualHost RewriteRule,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49701396/