Apache URL redirection

Soldato
Joined
18 May 2010
Posts
22,887
Location
London
Something like...

Code:
<VirtualHost *:*>
    ServerName example.web
    ... real host settings...
</VirtualHost>

<VirtualHost *:*>
    ServerName example.web
    Redirect permanent / http://example.web.local.com
</VirtualHost>

Havent tested but 'Redirect' should suffice.
 
Only partially fixed.

My solutions works in Firefox but not Chromium. :o

I added the following to the *:443 VHOST config which redirects any example.tst address to the FQDN https://example.tst.xyz.web.local.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.tst$
RewriteRule ^(.*)$ https://example.tst.xyz.web.local/$1 [R=301,L]

It seems the above code doesn't work in Chromium.... any one have any ideas I can achieve the above in a different way?

---

I looked at it again this afternoon. I can see that although it might work in Firefox, it's not 'correct' so need to sit down and have another go at it.
 
Last edited:
Back
Top Bottom