Зробити переадресацію в Apache легко (mod_alias):
RedirectMatch ^.*$ http://portal.example.com/
Налаштування заголовків кешу однаково просто:
Header set Cache-Control max-age=0
Header set Expires "Thu, 01 Dec 1994 16:00:00 GMT"
(Я не хочу, щоб цей кеш-пам'ять)
Але! Здається, ви не можете поєднати ці два. Ця конфігурація призводить до того, що переадресація надсилається, але не заголовки:
<VirtualHost *:80>
ServerName __default__
Header set Cache-Control max-age=0
Header set Expires "Thu, 01 Dec 1994 16:00:00 GMT"
RedirectMatch ^.*$ http://portal.example.com/
</VirtualHost>
Приклад того, що насправді відбувається:
jb@apto % telnet 192.168.0.1 80
Trying 192.168.0.1...
Connected to redirector.example.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: foo
HTTP/1.1 302 Found
Date: Sat, 21 Aug 2010 09:36:38 GMT
Server: Apache/2.2.9 (Debian) Phusion_Passenger/2.2.9
Location: http://portal.example.com/
Vary: Accept-Encoding
Content-Length: 316
Content-Type: text/html; charset=iso-8859-1
(etc)
Будь-які ідеї, як повернути переспрямування із заголовками кеша?