我已将 virtualhost .conf 文件包含到我的 httpd.conf 中,其内容如下:
root@phpbb3:/usr/local/etc/apache24 # cat ./sites-enabled/000-www.domain.com.conf
<VirtualHost *:*>
ServerName www.domain.com
Redirect 301 / https://discordapp.com/invite/xxxxx
</VirtualHost>
然而当访问 url 时www.域名.com我可以forum.domain.com我不知道为什么,我在尝试创建一些 virtualHost 配置时一定配置错误了某些内容,但现在我已经删除了除 www.domain.com 之外的所有内容,但仍然无法使其重定向到 discordapp.com..
root@phpbb3:/usr/local/etc/apache24 # apachectl -S
VirtualHost configuration:
*:* www.domain.com (/usr/local/etc/apache24/sites-
enabled/000-www.domain.com.conf:1)
ServerRoot: "/usr/local"
Main DocumentRoot: "/usr/local/www/apache24/data"
Main ErrorLog: "/var/log/httpd-error.log"
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
PidFile: "/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www" id=80
Group: name="www" id=80
答案1
Redirect 301 / https://discordapp.com/invite/xxxxx
尝试用Redirect permanent / https://discordapp.com/invite/xxxxx
或替换Redirect / https://discordapp.com/invite/xxxxx