0

I’m running a VPS (Debian 9) with Apache2 service running on it. I want to have a mail.example.com direct traffic to /var/www/mail and example.com to direct traffic to /var/www/example. I have written and rewritten the virtual hosts conf many times and mail.example.com always directs traffic to the wrong place on my machine.

Could it have something to do with certbot/letsencrypt? I know it changes apache settings. When I first made my SSL cert, I made a rule for mail.example.com but “told” let’s encrypt it was located in the other location. Any help would be appreciated.

I will add specific information when I am off of work.

Patrick Mevzek
  • 9,921
  • 7
  • 32
  • 43
  • You should indeed start by providing the configuration that you say is not working because your setup is very very generic, nothing special. – Patrick Mevzek Jun 05 '18 at 01:15
  • Hey, I figured it. There were `RewriteEngine` rules at the bottom of my Virtual-Hosts.conf files that I believe were generated by certbot. Removing these lines brought about the intended behavior. – OurGuyJohn Jun 05 '18 at 18:05
  • Then answer your own question and mark it as accepted. – Patrick Mevzek Jun 05 '18 at 18:44

1 Answers1

0

There were lines of code that needed to be removed from the virtualhost.conf files. I removed them and things work as intended.