I have included virtualhost .conf file into my httpd.conf with the following content:

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

However when accessing url www.domain.com I get to forum.domain.com which I can't figure out why, I must have misconfigured something while trying to create some virtualHost configs, but now I have removed all of them except for www.domain.com and am still not able to make it redirect to discordapp.com..

root@phpbb3:/usr/local/etc/apache24 # apachectl -S
VirtualHost configuration:
*:*                    www.domain.com (/usr/local/etc/apache24/sites- 
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"
User: name="www" id=80
Group: name="www" id=80

Try to replace the Redirect 301 / https://discordapp.com/invite/xxxxx by Redirect permanent / https://discordapp.com/invite/xxxxx or Redirect / https://discordapp.com/invite/xxxxx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.