1

I'm basically trying to redirect every request on :443 to :443. I found this way to do that, which work pretty nicely, once the visitor discard the SSL alert (my certificate isn't valid for my IP, of course), he's redirected correctly:

<VirtualHost *:443>
    SSLEngine off
    ServerAdmin [email protected]
    ServerName 11.11.11.11
    Redirect Permanent / https://domain.eu/
</VirtualHost>

But I enabled IPv6 on my server today, so I'd like to redirect it too, but the problems begin here.

<VirtualHost *:443>
    SSLEngine off
    ServerAdmin [email protected]
    ServerName [ff:ff:8:ff::1]         //(with or without '[]')
    Redirect Permanent / https://domain.eu/
</VirtualHost>

It simply won't work. I'm not sure if that's because of some missing support of IPv6 in the ServerName argument, but I'm kinda stuck.

Do you have any idea ? Thanks !

0

3 Answers 3

0

As far as I know, ServerName directive does not allow an IPv6 address.

It won't accept the brackets nor the colon character of an IPv6 address.

That format is only valid for Listen, NameVirtualHost and VirtualHost directives.

Depending on your configuration (ie: if you server multiple domains on the same Apache installation) you could try the following.

Create a vhost as you would normally and instead of defining a ServerName with an IPv6 address, define it with a proper dns name (which doesn't have to really exist).
Now the trick is to put this vhost on top of every other vhost for that IP:Port.

That way, when a user makes a request for a domain (or IP in your case) that it's not handled by Apache it will try to serve the request by using the first VirtualHost it finds for that IP:Port.

0

First, '[' and ']' are not valid for DNS naming convention, that must be fulfilled in ServerName value. Second, ':' is not valid too - so try to use it without that symbols or use a hostname - second way is better.

2
0

Have you tried this?

Listen [ff:ff:8:ff::1]:80;
<VirtualHost [ff:ff:8:ff::1]:443>
    SSLEngine off
    ServerAdmin [email protected]
    Redirect Permanent / https://domain.eu/
</VirtualHost>

Process the request depending on listening addess.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .