0

I'm managing a LAMP stack and have tried to get a subdomain to redirect to an external url. We are running Apache 2.2.22 (Debian).

I have created a simple virtual host to redirect to the external url:

<VirtualHost *:80>
  ServerName sub.mydomain.tld
  RedirectPermanent / https://outgoing.url/
</VirtualHost>

After enabling the virtual host and reloading apache2 the subdomain works correctly for browsers that haven't visited the main site before and incognito windows, but if I have visited the main site before it will redirect to the main site.

I'm guessing it is a caching problem, but I can't figure out how to fix it so that visitors that have visited the main site before can visit the subdomain without clearing their cache.

1 Answers1

0

Ctrl+F5 ? Clients need clear cache. By default, cache keeps data 1-3 hours.

Smithson
  • 133
  • 3
  • Ctrl+F5 and clearing cookies and data from the specific site did not work, but clearing files+image cache from all sites did work. I guess I'll just have to wait a while before it'll be visible for everyone, thanks! – kaascroissant Sep 07 '16 at 12:01
  • Just for future reference: When you change the target of your domain name this won't help, you will just have to wait until the DNS-Servers between the clients and the site have refreshed their caches, I once had a worst case scenario with an ISPs DNS having a 24h cache. And I kept thinking I misconfigured something. – Broco Sep 07 '16 at 12:14